From 29996a4d9f4bf0c68e638ef2f57f9e57b95aa08e Mon Sep 17 00:00:00 2001 From: Lukas Scheller <45085299+Schottkyc137@users.noreply.github.com> Date: Sat, 21 Sep 2024 18:01:01 +0200 Subject: [PATCH] Enable setting custom libraries path (#98) --- client/src/extension.ts | 10 ++++++++++ package.json | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/client/src/extension.ts b/client/src/extension.ts index 0af193e..c5567b4 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -98,6 +98,16 @@ export async function activate(ctx: ExtensionContext) { break; } + let librariesLocation = workspace + .getConfiguration() + .get('vhdlls.standardLibraries'); + + if (lsBinary !== 'docker' && librariesLocation) { + const args = ['--libraries', librariesLocation as string]; + serverOptions.run.args = args; + serverOptions.debug.args = args; + } + // Options to control the language client let clientOptions: LanguageClientOptions = { documentSelector: [{ scheme: 'file', language: 'vhdl' }], diff --git a/package.json b/package.json index d4bf3ac..a09e519 100644 --- a/package.json +++ b/package.json @@ -119,6 +119,10 @@ "Add the file to an anonymous library and analyze that file" ], "default": "analyze" + }, + "vhdlls.standardLibraries": { + "type": "string", + "description": "Defines the path where the VHDL standard libraries (ieee, std, ...) are located. If omitted, will search in pre-defined standard paths for these libraries" } } },