Skip to content

Commit 2600f75

Browse files
authored
Add settings for non-project files (#87)
1 parent 265ffca commit 2600f75

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ UNISIM.files = [
5353
UNISIM.is_third_party = true
5454
```
5555

56+
### Non-project files
57+
By default, files that are not part of the project are added and analyzed as part of an anonymous library. You can disable this behaviour by changing the `vhdlls.nonProjectFiles` setting from `analyze` to `ignore`. Note that changing this setting requires a restart of the langauge server to become effective.
58+
5659
## Technology under the hood
5760
This extension is based on the [VHDL-LS](https://github.com/VHDL-LS/rust_hdl#vhdl-language-server) Language Server.
5861
Pre-compiled binaries for Linux and Windows are provided with the extension.

client/src/extension.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export async function activate(ctx: ExtensionContext) {
101101
// Options to control the language client
102102
let clientOptions: LanguageClientOptions = {
103103
documentSelector: [{ scheme: 'file', language: 'vhdl' }],
104-
initializationOptions: workspace.getConfiguration('vhdlls'),
104+
initializationOptions: () => workspace.getConfiguration('vhdlls'),
105105
traceOutputChannel,
106106
};
107107
if (workspace.workspaceFolders) {

package.json

+13
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,19 @@
106106
],
107107
"default": "off",
108108
"description": "Trace requests to the vhdl_ls language server (this is usually overly verbose and not recommended for regular users)"
109+
},
110+
"vhdlls.nonProjectFiles": {
111+
"type": "string",
112+
"description": "Defines how the server handles files that are not part of the vhdl_ls.toml configuration file",
113+
"enum": [
114+
"ignore",
115+
"analyze"
116+
],
117+
"enumDescriptions": [
118+
"Ignore any non-project file",
119+
"Add the file to an anonymous library and analyze that file"
120+
],
121+
"default": "analyze"
109122
}
110123
}
111124
},

0 commit comments

Comments
 (0)