dafny-lang / ide-vscode

VSCode IDE Integration for Dafny
https://marketplace.visualstudio.com/items?itemName=dafny-lang.ide-vscode
MIT License
23 stars 18 forks source link

Export ExtensionRuntime (or LanguageClient) for other extensions #483

Closed BurstingF closed 2 months ago

BurstingF commented 2 months ago

This change would export the ExtensionRuntime object that is created such that other extensions can access it. This would, for example, allow other extensions to depend on this extension and use the LanguageClient it creates to send requests without the need to start their own LanguageClient.

With the current changes other extensions could access the LanguageClient like this:

const client: LanguageClient = vscode.extensions.getExtension('dafny-lang.ide-vscode')?.exports.client;
client.sendRequest(...)

Note: Perhaps if exporting ExtensionRuntime is a bit too broad, only the LanguageClient could be exported instead.

keyboardDrummer commented 2 months ago

Seems good, thanks