diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-07 15:58:55 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-07 15:58:55 +0800 |
commit | 3869c8fc53fb6e014ee6570a96429ea36c707ef9 (patch) | |
tree | cc979163cc0f1eecede64739bd8a5630984ebb5e /client | |
parent | 5dce334f3cf6bde54c2768e0e9da145b0f50024c (diff) | |
download | lua-language-server-3869c8fc53fb6e014ee6570a96429ea36c707ef9.zip |
支持多语言
Diffstat (limited to 'client')
-rw-r--r-- | client/src/extension.ts | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/client/src/extension.ts b/client/src/extension.ts index e9936119..ae2a1d89 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -4,7 +4,7 @@ * ------------------------------------------------------------------------------------------ */ import * as path from 'path'; -import { workspace, ExtensionContext } from 'vscode'; +import { workspace, ExtensionContext, env } from 'vscode'; import { LanguageClient, @@ -16,13 +16,7 @@ import { let client: LanguageClient; export function activate(context: ExtensionContext) { - // The server is implemented in node - let serverModule = context.asAbsolutePath( - path.join('server', 'out', 'server.js') - ); - // The debug options for the server - // --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging - let debugOptions = { execArgv: ['--nolazy', '--inspect=6009'] }; + let language = env.language; // If the extension is launched in debug mode then the debug server options are used // Otherwise the run options are used @@ -33,6 +27,8 @@ export function activate(context: ExtensionContext) { ), args: [ '-E', + '-e', + 'LANG="' + language + '"', context.asAbsolutePath( path.join('server', 'main.lua') ) @@ -49,6 +45,8 @@ export function activate(context: ExtensionContext) { ), args: [ '-E', + '-e', + 'LANG="' + language + '"', context.asAbsolutePath( path.join('server', 'main.lua') ) @@ -73,8 +71,8 @@ export function activate(context: ExtensionContext) { // Create the language client and start the client. client = new LanguageClient( - 'languageServerExample', - 'Language Server Example', + 'sumneko.lua-lsp', + 'sumneko.lua-lsp', serverOptions, clientOptions ); |