(context: ExtensionContext)
| 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. |
nothing calls this directly
no test coverage detected