Skip to content

Commit 11b9f82

Browse files
authored
Fix: Do not substitute environment variables on windows (#280)
1 parent e110136 commit 11b9f82

File tree

4 files changed

+110
-89
lines changed

4 files changed

+110
-89
lines changed

Cargo.lock

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 58 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,43 @@
11
# Overview
2+
23
This repository contains a fast VHDL language server and analysis library written in Rust.
34

45
The speed makes the tool very pleasant to use since it loads projects really fast and does not consume a lot of ram.
5-
A 200.000 line VHDL project is analyzed in 160 ms on my Desktop using 8 cores and only consumes 180 MByte of RAM when loaded.
6+
A 200.000 line VHDL project is analyzed in 160 ms on my Desktop using 8 cores and only consumes 180 MByte of RAM when
7+
loaded.
68

7-
I very much appreciate help from other people especially regarding semantic analysis of VHDL. You do not need to be a programmer to help, it is even more helpful to interpret and clarify the VHDL standard and provide minimal examples and describe how they should work according to the standard. Further information about contributing can be found by reading the [Contributors Guide](https://github.com/kraigher/rust_hdl/wiki/Contributor-Guide)
9+
I very much appreciate help from other people especially regarding semantic analysis of VHDL. You do not need to be a
10+
programmer to help, it is even more helpful to interpret and clarify the VHDL standard and provide minimal examples and
11+
describe how they should work according to the standard. Further information about contributing can be found by reading
12+
the [Contributors Guide](https://github.com/kraigher/rust_hdl/wiki/Contributor-Guide)
813

914
[![Chat](https://img.shields.io/matrix/VHDL-LS:matrix.org)](https://matrix.to/#/#VHDL-LS:matrix.org)
1015
[![Build Status](https://github.com/kraigher/rust_hdl/workflows/Build%20%26%20test%20all%20configs/badge.svg)](https://github.com/kraigher/rust_hdl/actions?query=workflow%3A%22Build+%26+test+all+configs%22)
1116

1217
## Contributors
18+
1319
- Maintainer: [Lukas Scheller](https://github.com/Schottkyc137)
1420
- Founder: [Olof Kraigher](https://github.com/kraigher)
15-
21+
1622
# Projects
23+
1724
## VHDL Language Server
25+
1826
[![vhdl ls crate](https://img.shields.io/crates/v/vhdl_ls.svg)](https://crates.io/crates/vhdl_ls)
27+
1928
### Goals
29+
2030
- A complete VHDL language server protocol implementation with diagnostics, navigate to symbol, find all references etc.
2131

2232
### Features
23-
- Live syntax and type checking
33+
34+
- Live syntax and type checking
2435
- Checks for missing and duplicate declarations
2536
- Supports goto-definition/declaration (also in presence of overloading)
2637
- Supports find-references (also in presence of overloading)
2738
- Supports goto-implementation
28-
- From component declaration to matching entity by default binding
29-
- From entity to matching component declaration by default binding
39+
- From component declaration to matching entity by default binding
40+
- From entity to matching component declaration by default binding
3041
- Supports hovering symbols
3142
- Rename symbol
3243
- Find workspace symbols
@@ -35,16 +46,21 @@ I very much appreciate help from other people especially regarding semantic anal
3546
## When Installing it from Crate
3647

3748
When installing the VHDL_LS from [crates.io](https://crates.io/crates/vhdl_ls) the required
38-
[vhdl_libraries](https://github.com/VHDL-LS/rust_hdl/tree/master/vhdl_libraries) directory will not be installed automatically and
39-
will need to be copied into the parent directory of the VHDL_LS binary manually.
49+
[vhdl_libraries](https://github.com/VHDL-LS/rust_hdl/tree/master/vhdl_libraries) directory will not be installed
50+
automatically and
51+
will need to be copied into the parent directory of the VHDL_LS binary manually.
4052

4153
## Trying it out
42-
A language server is never used directly by the end user and it is integrated into different editor plugins. The ones I know about are listed here.
54+
55+
A language server is never used directly by the end user and it is integrated into different editor plugins. The ones I
56+
know about are listed here.
4357

4458
## Use in VSCode
59+
4560
https://github.com/Bochlin/rust_hdl_vscode
4661

4762
## Use in emacs
63+
4864
VHDL LS has built-in support by emacs `lsp-mode` since 2020-01-04.
4965

5066
It can be set up automatically by installing the package
@@ -61,13 +77,17 @@ following snippet to your config:
6177
## Installation for Neovim
6278

6379
### Automatic Installation
64-
You can install `rust_hdl` automatically in Neovim using [`:Mason`](https://github.com/williamboman/mason.nvim). Within Mason, the package is called `rust_hdl`. If you don't have `:Mason`, you can simply install the binary as previously described.
80+
81+
You can install `rust_hdl` automatically in Neovim using [`:Mason`](https://github.com/williamboman/mason.nvim). Within
82+
Mason, the package is called `rust_hdl`. If you don't have `:Mason`, you can simply install the binary as previously
83+
described.
6584

6685
### Automatic Configuration using `nvim-lspconfig`
6786

68-
[`nvim-lspconfig`](https://github.com/neovim/nvim-lspconfig) has a built in configuration for [`vhdl_ls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#vhdl_ls)
87+
[`nvim-lspconfig`](https://github.com/neovim/nvim-lspconfig) has a built in configuration
88+
for [`vhdl_ls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#vhdl_ls)
6989

70-
In order to configure it, simply add
90+
In order to configure it, simply add
7191

7292
```lua
7393
lspconfig = require('lspconfig')
@@ -78,11 +98,12 @@ lspconfig['vhdl_ls'].setup({
7898
```
7999

80100
### Manual Configuration using Neovim's built in client
101+
81102
Neovim provides an LSP client to the VHDL_LS language server. Download the
82103
VHDL_LS release. The binary must be on the path and executable (if you can run
83104
"vhdl_ls -h" in the terminal then you're good).
84105

85-
In your Neovim config.lua add the following:
106+
In your Neovim config.lua add the following:
86107

87108
```lua
88109
function STARTVHDLLS()
@@ -99,9 +120,12 @@ server. There are also other options, like automatically starting it when
99120
opening a certain file type, see the [Neovim LSP documentation](https://neovim.io/doc/user/lsp.html) for more.
100121

101122
## Configuration
102-
The language server needs to know your library mapping to perform full analysis of the code. For this it uses a configuration file in the [TOML](https://github.com/toml-lang/toml) format named `vhdl_ls.toml`.
123+
124+
The language server needs to know your library mapping to perform full analysis of the code. For this it uses a
125+
configuration file in the [TOML](https://github.com/toml-lang/toml) format named `vhdl_ls.toml`.
103126

104127
`vhdl_ls` will load configuration files in the following order of priority (first to last):
128+
105129
1. A file named `.vhdl_ls.toml` in the user home folder.
106130
2. A file name from the `VHDL_LS_CONFIG` environment variable.
107131
3. A file named `vhdl_ls.toml` in the workspace root.
@@ -114,37 +138,47 @@ Settings in a later files overwrites those from previously loaded files.
114138
# File names are either absolute or relative to the parent folder of the vhdl_ls.toml file
115139
[libraries]
116140
lib2.files = [
117-
'pkg2.vhd',
141+
'pkg2.vhd',
118142
]
119143
lib1.files = [
120-
'pkg1.vhd',
121-
'tb_ent.vhd'
144+
'pkg1.vhd',
145+
'tb_ent.vhd'
122146
]
123147

124148
# Wildcards are supported
125149
lib3.files = [
126-
'test/*.vhd',
127-
'src/*.vhd',
128-
'src/*/*.vhd',
150+
'test/*.vhd',
151+
'src/*.vhd',
152+
'src/*/*.vhd',
129153
]
130154

131155
# Libraries can be marked as third-party to disable some analysis warnings, such as unused declarations
132156
UNISIM.files = [
133-
'C:\Xilinx\Vivado\2023.1\data\vhdl\src\unisims\unisim_VCOMP.vhd',
157+
'C:\Xilinx\Vivado\2023.1\data\vhdl\src\unisims\unisim_VCOMP.vhd',
134158
]
135159
UNISIM.is_third_party = true
136160
```
137161

162+
Paths in the `vhdl_ls.toml` can contain glob patterns (i.e., `.../*/`).
163+
On Unix machines, they can also contain environment variables using the default `$NAME` or `${NAME}` syntax.
164+
138165
## As an LSP-client developer how should I integrate VHDL-LS?
139-
I recommend that the `lsp-client` polls GitHub and downloads the [latest](https://github.com/VHDL-LS/rust_hdl/releases/latest) VHDL-LS release from GitHub.
140166

141-
VHDL-LS has frequent releases and the automatic update ensures minimal maintenance for the `lsp-client` developer as well as ensuring the users are not running and outdated version.
167+
I recommend that the `lsp-client` polls GitHub and downloads
168+
the [latest](https://github.com/VHDL-LS/rust_hdl/releases/latest) VHDL-LS release from GitHub.
169+
170+
VHDL-LS has frequent releases and the automatic update ensures minimal maintenance for the `lsp-client` developer as
171+
well as ensuring the users are not running and outdated version.
142172

143173
## VHDL Language Frontend
174+
144175
[![vhdl language frontend crate](https://img.shields.io/crates/v/vhdl_lang.svg)](https://crates.io/crates/vhdl_lang)
176+
145177
### Goals
178+
146179
- This project aims to provide a fully featured open source VHDL frontend that is easy to integrate into other tools.
147-
- A design goal of the frontend is to be able to recover from syntax errors such that it is useful for building a language server.
180+
- A design goal of the frontend is to be able to recover from syntax errors such that it is useful for building a
181+
language server.
148182
- Analysis order must be automatically computed such that the user does not have to maintain a compile order.
149183
- Comments will be part of the AST to support document generation.
150184
- Separate parsing from semantic analysis to allow code formatting on non-semantically correct code.

vhdl_lang/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ parking_lot = "0"
2626
dunce = "1"
2727
pinned_vec = "0"
2828
itertools = "0"
29+
subst = "0.3.0"
2930

3031
[dev-dependencies]
3132
tempfile = "3"

0 commit comments

Comments
 (0)