Skip to content

Commit

Permalink
Add settings for non-project files (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
Schottkyc137 authored Apr 28, 2024
1 parent 265ffca commit 2600f75
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ UNISIM.files = [
UNISIM.is_third_party = true
```

### Non-project files
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.

## Technology under the hood
This extension is based on the [VHDL-LS](https://github.com/VHDL-LS/rust_hdl#vhdl-language-server) Language Server.
Pre-compiled binaries for Linux and Windows are provided with the extension.
Expand Down
2 changes: 1 addition & 1 deletion client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export async function activate(ctx: ExtensionContext) {
// Options to control the language client
let clientOptions: LanguageClientOptions = {
documentSelector: [{ scheme: 'file', language: 'vhdl' }],
initializationOptions: workspace.getConfiguration('vhdlls'),
initializationOptions: () => workspace.getConfiguration('vhdlls'),
traceOutputChannel,
};
if (workspace.workspaceFolders) {
Expand Down
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,19 @@
],
"default": "off",
"description": "Trace requests to the vhdl_ls language server (this is usually overly verbose and not recommended for regular users)"
},
"vhdlls.nonProjectFiles": {
"type": "string",
"description": "Defines how the server handles files that are not part of the vhdl_ls.toml configuration file",
"enum": [
"ignore",
"analyze"
],
"enumDescriptions": [
"Ignore any non-project file",
"Add the file to an anonymous library and analyze that file"
],
"default": "analyze"
}
}
},
Expand Down

0 comments on commit 2600f75

Please sign in to comment.