mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 00:28:52 +01:00
Contribute to html language server with a custom language. (#146731)
* Contribute to html language server with a custom language. Fixes #146730 Signed-off-by: azerr <azerr@redhat.com> * refactor out LanguageParticipants * restart client on language selector change * htmlLanguage -> htmlLanguageParticipants * tune autoInsert wording * tune autoInsert description Co-authored-by: azerr <azerr@redhat.com> Co-authored-by: Martin Aeschlimann <martinae@microsoft.com>
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Disposable, ExtensionContext, Uri } from 'vscode';
|
||||
import { BaseLanguageClient, LanguageClientOptions } from 'vscode-languageclient';
|
||||
import { startClient, LanguageClientConstructor } from '../htmlClient';
|
||||
import { LanguageClientOptions } from 'vscode-languageclient';
|
||||
import { startClient, LanguageClientConstructor, AsyncDisposable } from '../htmlClient';
|
||||
import { LanguageClient } from 'vscode-languageclient/browser';
|
||||
|
||||
declare const Worker: {
|
||||
@@ -15,7 +15,7 @@ declare const TextDecoder: {
|
||||
new(encoding?: string): { decode(buffer: ArrayBuffer): string };
|
||||
};
|
||||
|
||||
let client: BaseLanguageClient | undefined;
|
||||
let client: AsyncDisposable | undefined;
|
||||
|
||||
// this method is called when vs code is activated
|
||||
export async function activate(context: ExtensionContext) {
|
||||
@@ -42,7 +42,7 @@ export async function activate(context: ExtensionContext) {
|
||||
|
||||
export async function deactivate(): Promise<void> {
|
||||
if (client) {
|
||||
await client.stop();
|
||||
await client.dispose();
|
||||
client = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user