diff --git a/extension.js b/extension.js index cd0bc5a..737e0bc 100644 --- a/extension.js +++ b/extension.js @@ -25,7 +25,7 @@ export function activate(context) { // } if (!executable) { - switch(os.platform()) { + switch (os.platform()) { case "win32": { executable = path.join(context.extensionPath, "c3-lsp-windows-amd64.exe"); break; @@ -44,30 +44,34 @@ export function activate(context) { // Otherwise the run options are used let args = []; - + if (c3Config.get('sendCrashReports')) { args.push('--send-crash-reports'); } if (c3Config.get('c3.path')) { - args.push('--c3c-path=' + c3Config.get('c3.path')); - } + args.push('--c3c-path=' + c3Config.get('c3.path')); + } + + if (c3Config.get('c3.stdlibPath')) { + args.push('--stdlib-path=' + c3Config.get('c3.stdlibPath')); + } - if (c3Config.get('log.path')) { - args.push('--log-path=' + c3Config.get('log.path')); - } + if (c3Config.get('log.path')) { + args.push('--log-path=' + c3Config.get('log.path')); + } - if (c3Config.get('c3.version')) { - args.push('--lang-version=' + c3Config.get('c3.version')); - } + if (c3Config.get('c3.version')) { + args.push('--lang-version=' + c3Config.get('c3.version')); + } if (c3Config.get('debug')) { args.push('--debug'); } if (c3Config.get('diagnosticsDelay')) { - args.push('--diagnostics-delay=' + c3Config.get('diagnosticsDelay')); - } + args.push('--diagnostics-delay=' + c3Config.get('diagnosticsDelay')); + } const serverOptions = { run: { @@ -75,7 +79,7 @@ export function activate(context) { args: args, }, debug: { - command:executable, + command: executable, args: args, options: { execArgv: ['--nolazy', '--inspect=6009'] } } diff --git a/package.json b/package.json index 3c4779a..8f9c2d3 100644 --- a/package.json +++ b/package.json @@ -38,11 +38,11 @@ } ], "snippets": [ - { - "language": "c3", - "path": "./snippets/snippets.json" - } - ], + { + "language": "c3", + "path": "./snippets/snippets.json" + } + ], "configuration": { "title": "Language Server", "properties": { @@ -85,6 +85,11 @@ "type": "string", "default": null, "markdownDescription": "Path to C3C binary. Use it if not defined already in your PATH environment variable or if you want to use a different one." + }, + "c3lspclient.lsp.c3.stdlibPath": { + "type": "string", + "default": null, + "markdownDescription": "Path to C3C stdlib." } } } @@ -106,4 +111,4 @@ "esbuild-base": "esbuild ./extension.js --bundle --outfile=dist/extension.js --external:vscode --format=cjs --platform=node", "esbuild": "npm run esbuild-base -- --sourcemap" } -} +} \ No newline at end of file