UNPKG

@yuebai008/cli

Version:

Command line interface for rapid qg-minigame development

1 lines 2.08 kB
import*as Bindings from"../bindings/bindings.js";import{ExtensionEndpoint}from"./ExtensionEndpoint.js";class LanguageExtensionEndpointImpl extends ExtensionEndpoint{plugin;constructor(e,n){super(n),this.plugin=e}handleEvent({event:e}){switch(e){case"unregisteredLanguageExtensionPlugin":{this.disconnect();const{pluginManager:e}=Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance();e&&e.removePlugin(this.plugin);break}}}}export class LanguageExtensionEndpoint{supportedScriptTypes;endpoint;name;constructor(e,n,t){this.name=e,this.supportedScriptTypes=n,this.endpoint=new LanguageExtensionEndpointImpl(this,t)}handleScript(e){const n=e.scriptLanguage();return null!==n&&null!==e.debugSymbols&&n===this.supportedScriptTypes.language&&this.supportedScriptTypes.symbol_types.includes(e.debugSymbols.type)}addRawModule(e,n,t){return this.endpoint.sendRequest("addRawModule",{rawModuleId:e,symbolsURL:n,rawModule:t})}removeRawModule(e){return this.endpoint.sendRequest("removeRawModule",{rawModuleId:e})}sourceLocationToRawLocation(e){return this.endpoint.sendRequest("sourceLocationToRawLocation",{sourceLocation:e})}rawLocationToSourceLocation(e){return this.endpoint.sendRequest("rawLocationToSourceLocation",{rawLocation:e})}getScopeInfo(e){return this.endpoint.sendRequest("getScopeInfo",{type:e})}listVariablesInScope(e){return this.endpoint.sendRequest("listVariablesInScope",{rawLocation:e})}getFunctionInfo(e){return this.endpoint.sendRequest("getFunctionInfo",{rawLocation:e})}getInlinedFunctionRanges(e){return this.endpoint.sendRequest("getInlinedFunctionRanges",{rawLocation:e})}getInlinedCalleesRanges(e){return this.endpoint.sendRequest("getInlinedCalleesRanges",{rawLocation:e})}async getMappedLines(e,n){return this.endpoint.sendRequest("getMappedLines",{rawModuleId:e,sourceFileURL:n})}async evaluate(e,n,t){return this.endpoint.sendRequest("formatValue",{expression:e,context:n,stopId:t})}getProperties(e){return this.endpoint.sendRequest("getProperties",{objectId:e})}releaseObject(e){return this.endpoint.sendRequest("releaseObject",{objectId:e})}}