mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-01 01:38:07 +08:00
[globals] self.UI.context
R=jacktfranklin@chromium.org Bug: 1058320 Change-Id: Icc1d806782e7624fff02e719670a2cca59070ddd Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2364594 Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
This commit is contained in:
committed by
Commit Bot
parent
8277d4dd06
commit
d1a00aacb9
@@ -20,7 +20,7 @@ export class JavaScriptAutocomplete {
|
||||
this._expressionCache = new Map();
|
||||
SDK.ConsoleModel.ConsoleModel.instance().addEventListener(
|
||||
SDK.ConsoleModel.Events.CommandEvaluated, this._clearCache, this);
|
||||
self.UI.context.addFlavorChangeListener(SDK.RuntimeModel.ExecutionContext, this._clearCache, this);
|
||||
UI.Context.Context.instance().addFlavorChangeListener(SDK.RuntimeModel.ExecutionContext, this._clearCache, this);
|
||||
SDK.SDKModel.TargetManager.instance().addModelListener(
|
||||
SDK.DebuggerModel.DebuggerModel, SDK.DebuggerModel.Events.DebuggerResumed, this._clearCache, this);
|
||||
SDK.SDKModel.TargetManager.instance().addModelListener(
|
||||
@@ -54,7 +54,7 @@ export class JavaScriptAutocomplete {
|
||||
if (!functionCall) {
|
||||
return null;
|
||||
}
|
||||
const executionContext = self.UI.context.flavor(SDK.RuntimeModel.ExecutionContext);
|
||||
const executionContext = UI.Context.Context.instance().flavor(SDK.RuntimeModel.ExecutionContext);
|
||||
if (!executionContext) {
|
||||
return null;
|
||||
}
|
||||
@@ -203,7 +203,7 @@ export class JavaScriptAutocomplete {
|
||||
*/
|
||||
async _mapCompletions(text, query) {
|
||||
const mapMatch = text.match(/\.\s*(get|set|delete)\s*\(\s*$/);
|
||||
const executionContext = self.UI.context.flavor(SDK.RuntimeModel.ExecutionContext);
|
||||
const executionContext = UI.Context.Context.instance().flavor(SDK.RuntimeModel.ExecutionContext);
|
||||
if (!executionContext || !mapMatch) {
|
||||
return [];
|
||||
}
|
||||
@@ -312,7 +312,7 @@ export class JavaScriptAutocomplete {
|
||||
* @return {!Promise<!UI.SuggestBox.Suggestions>}
|
||||
*/
|
||||
async _completionsForExpression(fullText, query, force) {
|
||||
const executionContext = self.UI.context.flavor(SDK.RuntimeModel.ExecutionContext);
|
||||
const executionContext = UI.Context.Context.instance().flavor(SDK.RuntimeModel.ExecutionContext);
|
||||
if (!executionContext) {
|
||||
return [];
|
||||
}
|
||||
@@ -674,7 +674,7 @@ export class JavaScriptAutocomplete {
|
||||
* @return {!Promise<boolean>}
|
||||
*/
|
||||
static async isExpressionComplete(expression) {
|
||||
const currentExecutionContext = self.UI.context.flavor(SDK.RuntimeModel.ExecutionContext);
|
||||
const currentExecutionContext = UI.Context.Context.instance().flavor(SDK.RuntimeModel.ExecutionContext);
|
||||
if (!currentExecutionContext) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user