[LMI][Plugin] Add support for opening LMI also with extension

This uses information from the language plugin on the address of
objects in order to open up the LMI view also for debugging with
the extension.


Also-by: [email protected], [email protected]
Bug: chromium:1157395
Change-Id: Ic4233a080b92c5b9ee771929ec1c70dabb4c4ab6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2652506
Reviewed-by: Philip Pfaffe <[email protected]>
Reviewed-by: Benedikt Meurer <[email protected]>
Commit-Queue: Kim-Anh Tran <[email protected]>
diff --git a/front_end/extensions/ExtensionAPI.js b/front_end/extensions/ExtensionAPI.js
index ba3fe9a..44b09c4 100644
--- a/front_end/extensions/ExtensionAPI.js
+++ b/front_end/extensions/ExtensionAPI.js
@@ -98,6 +98,7 @@
     EvaluateVariable: 'evaluateVariable',
     GetTypeInfo: 'getTypeInfo',
     GetFormatter: 'getFormatter',
+    GetInspectableAddress: 'getInspectableAddress',
     GetFunctionInfo: 'getFunctionInfo',
     GetInlinedFunctionRanges: 'getInlinedFunctionRanges',
     GetInlinedCalleesRanges: 'getInlinedCalleesRanges',
@@ -425,6 +426,11 @@
             return plugin.getTypeInfo(parameters.expression, parameters.context);
           case languageExtensionPluginCommands.GetFormatter:
             return plugin.getFormatter(parameters.expressionOrField, parameters.context);
+          case languageExtensionPluginCommands.GetInspectableAddress:
+            if ('getInspectableAddress' in plugin) {
+              return plugin.getInspectableAddress(parameters.field);
+            }
+            return Promise.resolve({js: ''});
           case languageExtensionPluginCommands.GetFunctionInfo:
             return plugin.getFunctionInfo(parameters.rawLocation);
           case languageExtensionPluginCommands.GetInlinedFunctionRanges: