2022-09-22 19:09:41 +03:00
|
|
|
## Features
|
|
|
|
|
|
|
|
This incomplete list tracks noteble features currently implemented or planned.
|
|
|
|
|
|
|
|
- [x] Goto definition. `textDocument/definition`
|
|
|
|
- [x] References to parameters, `let` and `rec {}` bindings.
|
|
|
|
- [x] Relative paths.
|
|
|
|
- [x] Find references. `textDocument/reference`
|
|
|
|
- [x] Parameters, `let` and `rec {}` bindings.
|
|
|
|
- [x] With expression.
|
2022-11-09 22:24:59 +03:00
|
|
|
- [x] Links. `textDocument/documentLink`
|
|
|
|
- [x] Links for relative and absolute paths.
|
|
|
|
- [ ] Links for search paths like `<nixpkgs>`.
|
|
|
|
- [x] Links for URLs like `"https://..."`, `"http://..."` and etc.
|
|
|
|
- [x] Links for [flake references][flake-ref] like `"github:NixOS/nixpkgs"`.
|
|
|
|
|
2022-11-23 20:41:27 +03:00
|
|
|
- [x] Code actions. `textDocument/codeAction`
|
|
|
|
- [x] Convert `name = name;` bindings to `inherit`.
|
2022-11-24 19:12:36 +03:00
|
|
|
- [x] Pack multiple bindings into one Attrset binding.
|
|
|
|
|
|
|
|
`{ foo.bar = 1; foo.baz = 2; }` => `{ foo = { bar = 1; baz = 2; }; }`
|
2022-11-23 20:41:27 +03:00
|
|
|
|
2022-11-24 20:22:32 +03:00
|
|
|
- [x] Flatten Attrset into outer level bindings.
|
|
|
|
|
|
|
|
`{ foo = { bar = 1; baz = 2; }; }` => `{ foo.bar = 1; foo.baz = 2; }`
|
|
|
|
|
2022-09-22 19:09:41 +03:00
|
|
|
- [x] Completion. `textDocument/completion`
|
|
|
|
- [x] Builtin names.
|
|
|
|
- With documentations.
|
|
|
|
- [x] Local bindings and rec-attrset fields.
|
|
|
|
- [x] Keywords.
|
|
|
|
- [ ] Attrset fields.
|
2022-11-23 20:41:27 +03:00
|
|
|
|
2022-09-22 19:09:41 +03:00
|
|
|
- [x] Diagnostics. `textDocument/publishDiagnostics`
|
2022-11-25 18:41:09 +03:00
|
|
|
|
2022-09-22 19:09:41 +03:00
|
|
|
- [x] Syntax errors.
|
|
|
|
- [x] Hard semantic errors reported as parse errors by Nix, like duplicated keys in attrsets.
|
|
|
|
- [x] Undefiend names.
|
|
|
|
- [x] Warnings of legacy syntax.
|
|
|
|
- [x] Warnings of unnecessary syntax.
|
|
|
|
- [x] Warnings of unused bindings, `with` and `rec`.
|
|
|
|
- [ ] Client pulled diagnostics.
|
2022-11-25 18:41:09 +03:00
|
|
|
- [x] Custom filter on kinds.
|
|
|
|
- [x] Exclude files.
|
2022-09-25 18:33:55 +03:00
|
|
|
|
2022-11-25 18:41:09 +03:00
|
|
|
You can disable some diagnostic kinds or for some (generated) files via LSP configuration.
|
|
|
|
See [docs/configuration.md](./configuration.md) for more information.
|
2022-09-25 18:33:55 +03:00
|
|
|
|
2022-09-22 19:09:41 +03:00
|
|
|
- [x] Expand selection. `textDocument/selectionRange`
|
|
|
|
- [x] Renaming. `textDocument/renamme`, `textDocument/prepareRename`
|
|
|
|
- [x] Identifiers in parameters and bindings, from `let`, rec and non-rec attrsets.
|
|
|
|
- [x] Static string literal bindings.
|
|
|
|
- [x] Merged path-value binding names.
|
|
|
|
- [x] Names introduced by `inherit`.
|
|
|
|
- [x] Names used by `inherit`.
|
|
|
|
- [ ] Conflict detection.
|
|
|
|
- [x] Rename to string literals.
|
|
|
|
- [x] Semantic highlighting. `textDocument/semanticTokens/{range,full}`
|
|
|
|
- [ ] Delta response. `textDocument/semanticTokens/full/delta`
|
|
|
|
- :warning: Currently it has performance issue for large files.
|
|
|
|
It may be slow to respond when editing `all-packages.nix`.
|
|
|
|
|
|
|
|
[`coc.nvim`] doesn't enable semantic highlighting by default.
|
|
|
|
You need to manually enable it in settings.
|
2022-09-26 10:53:04 +03:00
|
|
|
```jsonc
|
|
|
|
// coc-settings.json
|
2022-09-22 19:09:41 +03:00
|
|
|
{
|
|
|
|
"semanticTokens": { "filetypes": ["nix"] }
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
- [x] Hover text. `textDocument/hover`.
|
|
|
|
- [x] Show kind of names.
|
|
|
|
- [x] Documentation for builtin names.
|
2022-09-25 21:01:22 +03:00
|
|
|
- [x] File symbols with hierarchy (aka. outline). `textDocument/documentSymbol`
|
2022-09-26 10:53:04 +03:00
|
|
|
|
|
|
|
- [x] File formatting.
|
|
|
|
- [x] Whole file formatting.
|
|
|
|
- [ ] Range formatting.
|
|
|
|
- [ ] On-type formatting.
|
|
|
|
- [x] External formatter.
|
2022-11-25 18:41:09 +03:00
|
|
|
|
|
|
|
External formatter must be manually configured to work.
|
|
|
|
See [docs/configuration.md](./configuration.md) for more information.
|
|
|
|
|
|
|
|
When formatter is configured, you can also enable format-on-save in your editor.
|
|
|
|
Like, for [`coc.nvim`],
|
|
|
|
```jsonc
|
|
|
|
// coc-settings.json
|
|
|
|
{
|
|
|
|
"coc.preferences.formatOnSaveFiletypes": ["nix"]
|
|
|
|
}
|
|
|
|
```
|
2022-09-26 10:53:04 +03:00
|
|
|
|
2022-09-22 19:09:41 +03:00
|
|
|
- [ ] Cross-file analysis.
|
2022-09-27 16:08:24 +03:00
|
|
|
- [x] Multi-threaded.
|
|
|
|
- [x] Request cancellation. `$/cancelRequest`
|
2022-09-26 10:53:04 +03:00
|
|
|
|
|
|
|
[`coc.nvim`]: https://github.com/neoclide/coc.nvim
|
2022-11-09 22:24:59 +03:00
|
|
|
[flake-ref]: https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake.html#types
|