From 4c416bcd2820d623fa4a92224ceb1b7ddd1bd359 Mon Sep 17 00:00:00 2001 From: Daniel Jeffery <1425457+d-jeffery@users.noreply.github.com> Date: Fri, 29 Sep 2023 07:11:48 -0700 Subject: [PATCH] fix: document selector not working in github.dev (#73) --- client/src/extension.browser.ts | 7 ++----- client/src/extension.node.ts | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/client/src/extension.browser.ts b/client/src/extension.browser.ts index 708ad7d..dc0f2ac 100644 --- a/client/src/extension.browser.ts +++ b/client/src/extension.browser.ts @@ -9,11 +9,8 @@ let client: LanguageClient; // this method is called when vs code is activated export function activate(context: ExtensionContext) { - /* - * all except the code to create the language client in not browser specific - * and could be shared with a regular (Node) extension - */ - const documentSelector = [{ scheme: 'file', language: 'openfga' }, { scheme: 'untitled', language: 'openfga'}]; + // Register the server for all document types + const documentSelector = [{ language: 'openfga' }]; // Options to control the language client const clientOptions: LanguageClientOptions = { diff --git a/client/src/extension.node.ts b/client/src/extension.node.ts index 2e54aba..be95061 100644 --- a/client/src/extension.node.ts +++ b/client/src/extension.node.ts @@ -22,8 +22,8 @@ export function activate(context: ExtensionContext) { // Options to control the language client const clientOptions: LanguageClientOptions = { - // Register the server for plain text documents - documentSelector: [{ scheme: 'file', language: 'openfga' }, { scheme: 'untitled', language: 'openfga'}], + // Register the server for all document types + documentSelector: [{ language: 'openfga' }], synchronize: { // Notify the server about file changes to '.clientrc files contained in the workspace fileEvents: workspace.createFileSystemWatcher('**/.clientrc')