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
-[vscode-nim](https://github.com/nim-lang/vscode-nim) has support for `nimlangserver`. Follow the instructions at:
31
-
https://github.com/nim-lang/vscode-nim#using
33
+
https://github.com/nim-lang/vscode-nim#using
32
34
33
35
### Sublime Text
36
+
34
37
Install [LSP-nimlangserver](https://packagecontrol.io/packages/LSP-nimlangserver) from Package Control.
35
38
36
39
### Zed Editor
40
+
37
41
Install [Nim Extenstion](https://github.com/foxoman/zed-nim) from the Zed Editor extensions.
38
42
39
43
### Helix
44
+
40
45
Just install the langserver with Nimble and make sure it's on your PATH.
41
46
42
47
To verify that everything is set up, run:
48
+
43
49
```shell
44
50
$ hx --health nim
45
51
Configured language servers:
@@ -54,7 +60,9 @@ Configured language servers:
54
60
```
55
61
56
62
### Neovim
63
+
57
64
-[lsp](https://neovim.io/doc/user/lsp.html) Neovim has built-in LSP support. Although, you might want to use something like [lsp-config](https://github.com/neovim/nvim-lspconfig) to take care of the boilerplate code for the most LSP configurations. Install `lsp-config` using your favourite plugin manager an place the following code into your `init.vim` config:
Change configuration to your liking (most probably you don't need to provide any settings at all, defaults should work fine for the majority of the users). You might also want to read `lsp-config` documentation to setup key bindings, autocompletion and so on.
72
81
73
82
**IMPORTANT** you might want to use latest build of the `nimlangserver` and/or build it from source.
74
83
75
84
### VIM/Neovim
85
+
76
86
-[coc.nvim](https://github.com/neoclide/coc.nvim) supports both classical VIM as well as Neovim. It also supports vscode-like `coc-settings.json` for LSP configuration. Install the plugin via your favourite plugin manager, create `coc-settings.json` alongside your `init.vim` and add the following contents to it:
87
+
77
88
```json
78
89
{
79
90
"languageserver": {
@@ -90,14 +101,14 @@ Change configuration to your liking (most probably you don't need to provide any
90
101
}
91
102
}
92
103
```
93
-
Of course, change the configuration to your liking. You might also want to read `coc.nvim` documentation to setup key bindings, autocompletion and so on.
94
104
105
+
Of course, change the configuration to your liking. You might also want to read `coc.nvim` documentation to setup key bindings, autocompletion and so on.
95
106
96
107
## Configuration Options
97
108
98
109
-`nim.projectMapping` - configure how `nimsuggest` should be started. Here it is sample configuration for `VScode`. We don't want `nimlangserver` to start `nimsuggest` for each file and this configuration will allow configuring pair `projectFile`/`fileRegex` so when one of the regexp in the list matches current file then `nimls` will use `root` to start `nimsuggest`. In case there are no matches `nimlangserver` will try to guess the most suitable project root.
99
110
100
-
```json
111
+
```json
101
112
{
102
113
"nim.projectMapping": [{
103
114
// open files under tests using one nimsuggest instance started with root = test/all.nim
@@ -110,7 +121,8 @@ Of course, change the configuration to your liking. You might also want to read
110
121
}]
111
122
}
112
123
```
113
-
Note when in a nimble project, `nimble` will drive the entry points for `nimsuggest`.
124
+
125
+
Note when in a nimble project, `nimble` will drive the entry points for `nimsuggest`.
114
126
115
127
-`nim.timeout` - the request timeout in ms after which `nimlangserver` will restart the language server. If not specified the default is 2 minutes.
116
128
-`nim.nimsuggestPath` - the path to the `nimsuggest`. The default is `"nimsuggest"`.
@@ -136,19 +148,22 @@ Inlay hints are visual snippets displayed by the editor inside your code.
136
148
Typical usage for inlay hints is displaying type information but it can go beyond that and provide all sorts of useful context.
137
149
138
150
nimlangserver offers three kinds of inlay hints:
151
+
139
152
-**Type hints**. Show variable types.
140
-
-**Parameter hints**. TODO
141
153
-**Exception hints**. Highlight functions that raise exceptions.
154
+
-**Parameter hints**. Hints for param names in function calls.
155
+
-**Note:** This kind of inlay hints is not implemented yet so enabling it won't do anything at the moment. See [issue 183](https://github.com/nim-lang/langserver/issues/183).
0 commit comments