You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+58-24Lines changed: 58 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,32 +1,43 @@
1
1
# Overview
2
+
2
3
This repository contains a fast VHDL language server and analysis library written in Rust.
3
4
4
5
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.
6
8
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)
[](https://crates.io/crates/vhdl_ls)
27
+
19
28
### Goals
29
+
20
30
- A complete VHDL language server protocol implementation with diagnostics, navigate to symbol, find all references etc.
21
31
22
32
### Features
23
-
- Live syntax and type checking
33
+
34
+
- Live syntax and type checking
24
35
- Checks for missing and duplicate declarations
25
36
- Supports goto-definition/declaration (also in presence of overloading)
26
37
- Supports find-references (also in presence of overloading)
27
38
- 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
30
41
- Supports hovering symbols
31
42
- Rename symbol
32
43
- Find workspace symbols
@@ -35,16 +46,21 @@ I very much appreciate help from other people especially regarding semantic anal
35
46
## When Installing it from Crate
36
47
37
48
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.
40
52
41
53
## 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.
43
57
44
58
## Use in VSCode
59
+
45
60
https://github.com/Bochlin/rust_hdl_vscode
46
61
47
62
## Use in emacs
63
+
48
64
VHDL LS has built-in support by emacs `lsp-mode` since 2020-01-04.
49
65
50
66
It can be set up automatically by installing the package
@@ -61,13 +77,17 @@ following snippet to your config:
61
77
## Installation for Neovim
62
78
63
79
### 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.
65
84
66
85
### Automatic Configuration using `nvim-lspconfig`
67
86
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)
69
89
70
-
In order to configure it, simply add
90
+
In order to configure it, simply add
71
91
72
92
```lua
73
93
lspconfig=require('lspconfig')
@@ -78,11 +98,12 @@ lspconfig['vhdl_ls'].setup({
78
98
```
79
99
80
100
### Manual Configuration using Neovim's built in client
101
+
81
102
Neovim provides an LSP client to the VHDL_LS language server. Download the
82
103
VHDL_LS release. The binary must be on the path and executable (if you can run
83
104
"vhdl_ls -h" in the terminal then you're good).
84
105
85
-
In your Neovim config.lua add the following:
106
+
In your Neovim config.lua add the following:
86
107
87
108
```lua
88
109
functionSTARTVHDLLS()
@@ -99,9 +120,12 @@ server. There are also other options, like automatically starting it when
99
120
opening a certain file type, see the [Neovim LSP documentation](https://neovim.io/doc/user/lsp.html) for more.
100
121
101
122
## 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`.
103
126
104
127
`vhdl_ls` will load configuration files in the following order of priority (first to last):
128
+
105
129
1. A file named `.vhdl_ls.toml` in the user home folder.
106
130
2. A file name from the `VHDL_LS_CONFIG` environment variable.
107
131
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.
114
138
# File names are either absolute or relative to the parent folder of the vhdl_ls.toml file
115
139
[libraries]
116
140
lib2.files = [
117
-
'pkg2.vhd',
141
+
'pkg2.vhd',
118
142
]
119
143
lib1.files = [
120
-
'pkg1.vhd',
121
-
'tb_ent.vhd'
144
+
'pkg1.vhd',
145
+
'tb_ent.vhd'
122
146
]
123
147
124
148
# Wildcards are supported
125
149
lib3.files = [
126
-
'test/*.vhd',
127
-
'src/*.vhd',
128
-
'src/*/*.vhd',
150
+
'test/*.vhd',
151
+
'src/*.vhd',
152
+
'src/*/*.vhd',
129
153
]
130
154
131
155
# Libraries can be marked as third-party to disable some analysis warnings, such as unused declarations
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
+
138
165
## 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.
140
166
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.
142
172
143
173
## VHDL Language Frontend
174
+
144
175
[](https://crates.io/crates/vhdl_lang)
176
+
145
177
### Goals
178
+
146
179
- 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.
148
182
- Analysis order must be automatically computed such that the user does not have to maintain a compile order.
149
183
- Comments will be part of the AST to support document generation.
150
184
- Separate parsing from semantic analysis to allow code formatting on non-semantically correct code.
0 commit comments