This incomplete list tracks noteble features currently implemented or planned.
-
Goto definition.
textDocument/definition
- References to parameters,
let
andrec {}
bindings. - Relative paths.
- References to parameters,
-
Find references.
textDocument/reference
- Parameters,
let
andrec {}
bindings. - With expression.
- Parameters,
-
Highlight related.
textDocument/documentHighlight
.- Highlight definitions and references when cursor's on identifiers.
- Highlight all (attribute) references when cursor's on
with
. - Highlight all effective
with
s when cursor's on attributes fromwith
.
-
Links.
textDocument/documentLink
- Links for relative and absolute paths.
- Links for search paths like
<nixpkgs>
. - Links for URLs like
"https://..."
,"http://..."
and etc. - Links for flake references like
"github:NixOS/nixpkgs"
.
⚠️ Due to an issue incoc.nvim
, a lot of links can cause performance issue forcoc.nvim
, especially when editingall-packages.nix
. You could apply this patch to mitigate. -
Code actions.
textDocument/codeAction
-
Convert
name = name;
bindings toinherit
. -
Pack multiple bindings into one Attrset binding.
{ foo.bar = 1; foo.baz = 2; }
=>{ foo = { bar = 1; baz = 2; }; }
-
Flatten Attrset into outer level bindings.
{ foo = { bar = 1; baz = 2; }; }
=>{ foo.bar = 1; foo.baz = 2; }
-
-
Completion.
textDocument/completion
- Builtin names.
- With documentations.
- Local bindings and rec-attrset fields.
- Keywords.
- Attrset fields.
- Builtin names.
-
Diagnostics.
textDocument/publishDiagnostics
- Syntax errors.
- Hard semantic errors reported as parse errors by Nix, like duplicated keys in attrsets.
- Undefiend names.
- Warnings of legacy syntax.
- Warnings of unnecessary syntax.
- Warnings of unused bindings,
with
andrec
. - Client pulled diagnostics.
- Custom filter on kinds.
- Exclude files.
You can disable some diagnostic kinds or for some (generated) files via LSP configuration. See docs/configuration.md for more information.
-
Expand selection.
textDocument/selectionRange
-
Renaming.
textDocument/renamme
,textDocument/prepareRename
- Identifiers in parameters and bindings, from
let
, rec and non-rec attrsets. - Static string literal bindings.
- Merged path-value binding names.
- Names introduced by
inherit
. - Names used by
inherit
. - Conflict detection.
- Rename to string literals.
- Identifiers in parameters and bindings, from
-
Semantic highlighting.
textDocument/semanticTokens/{range,full}
- Delta response.
textDocument/semanticTokens/full/delta
Note:
coc.nvim
doesn't enable semantic highlighting by default. You need to manually enable it in settings.// coc-settings.json { "semanticTokens": { "filetypes": ["nix"] } }
- Delta response.
-
Hover text.
textDocument/hover
.- Show kind of names.
- Documentation for builtin names.
-
File symbols with hierarchy (aka. outline).
textDocument/documentSymbol
-
File formatting.
- Whole file formatting.
- Range formatting.
- On-type formatting.
- External formatter.
External formatter must be manually configured to work. See docs/configuration.md for more information.
When formatter is configured, you can also enable format-on-save in your editor. Like, for
coc.nvim
,// coc-settings.json { "coc.preferences.formatOnSaveFiletypes": ["nix"] }
-
Cross-file analysis.
-
Multi-threaded.
- Request cancellation.
$/cancelRequest
- Request cancellation.