Skip to content

Commit

Permalink
fix: force use VSCode display language in language server
Browse files Browse the repository at this point in the history
close #1959
  • Loading branch information
johnsoncodehk committed Oct 11, 2022
1 parent 7fa4c5f commit 5f1e740
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions extensions/vscode-vue-language-features/src/common.ts
Expand Up @@ -260,6 +260,7 @@ function getInitializationOptions(
vitePress: {
processMdFile: processMd(),
},
__language: vscode.env.language,
};
return initializationOptions;
}
2 changes: 1 addition & 1 deletion packages/language-server/src/server.ts
Expand Up @@ -123,7 +123,7 @@ export function createCommonLanguageServer(
const ts = runtimeEnv.loadTypescript(options.typescript.tsdk);
fsHost = runtimeEnv.createFileSystemHost(ts, params.capabilities);

const tsLocalized = params.locale ? runtimeEnv.loadTypescriptLocalized(options.typescript.tsdk, params.locale) : undefined;
const tsLocalized = params.locale ? runtimeEnv.loadTypescriptLocalized(options.typescript.tsdk, options.__language ?? params.locale) : undefined;
const cancelTokenHost = createCancellactionTokenHost(options.cancellationPipeName);
const _projects = createWorkspaces(
runtimeEnv,
Expand Down
2 changes: 2 additions & 0 deletions packages/language-server/src/types.ts
Expand Up @@ -113,4 +113,6 @@ export interface LanguageServerInitializationOptions {
* https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29#cancellation
*/
cancellationPipeName?: string;
// temporary workaround to fix https://github.com/johnsoncodehk/volar/issues/1959
__language?: string;
}

0 comments on commit 5f1e740

Please sign in to comment.