MCPcopy
hub / github.com/APKLab/APKLab / register

Function register

src/tools/smali-lsp.ts:178–191  ·  view source on GitHub ↗
(context: ExtensionContext)

Source from the content-addressed store, hash-verified

176 * Lazily starts the server when a .smali file is opened.
177 */
178 export function register(context: ExtensionContext): void {
179 const onOpen = workspace.onDidOpenTextDocument((document) => {
180 if (document.languageId === "smali" && !client) {
181 startServer(document);
182 }
183 });
184 context.subscriptions.push(onOpen);
185
186 // Check if a smali file is already open
187 const activeEditor = window.activeTextEditor;
188 if (activeEditor?.document.languageId === "smali") {
189 startServer(activeEditor.document);
190 }
191 }
192
193 /**
194 * Returns true if the LSP server is currently running.

Callers

nothing calls this directly

Calls 1

startServerFunction · 0.85

Tested by

no test coverage detected