2022-11-25 18:41:09 +03:00
|
|
|
## LSP Configuration
|
|
|
|
|
2023-03-08 07:20:59 +03:00
|
|
|
There are some tunable options and settings for nil.
|
2022-12-25 00:09:04 +03:00
|
|
|
They are retrieved via LSP and support runtime modification.
|
2022-11-25 18:41:09 +03:00
|
|
|
|
|
|
|
All settings are nested under a key `"nil"`.
|
|
|
|
For example, `formatting.command` means to write
|
|
|
|
`"nil": { "formatting": { "command": ["your-command"] } }`
|
|
|
|
in JSON, not `"nil.formatting.command": ["wrong"]`.
|
|
|
|
|
2023-03-08 07:20:59 +03:00
|
|
|
The place to write LSP configurations differs between clients (i.e. editors and editor plugins).
|
|
|
|
Please refer to their corresponding documentation.
|
2022-11-25 18:41:09 +03:00
|
|
|
There are some examples for common editor/plugins in [README](../README.md).
|
|
|
|
|
|
|
|
### Reference
|
|
|
|
|
2023-03-08 07:20:59 +03:00
|
|
|
Default configuration:
|
2022-11-25 18:41:09 +03:00
|
|
|
|
|
|
|
```jsonc
|
|
|
|
{
|
|
|
|
"nil": {
|
|
|
|
"formatting": {
|
|
|
|
// External formatter command (with arguments).
|
|
|
|
// It should accepts file content in stdin and print the formatted code into stdout.
|
|
|
|
// Type: [string] | null
|
|
|
|
// Example: ["nixpkgs-fmt"]
|
2022-12-25 00:09:04 +03:00
|
|
|
"command": null,
|
2022-11-25 18:41:09 +03:00
|
|
|
},
|
|
|
|
"diagnostics": {
|
|
|
|
// Ignored diagnostic kinds.
|
|
|
|
// The kind identifier is a snake_cased_string usually shown together
|
|
|
|
// with the diagnostic message.
|
|
|
|
// Type: [string]
|
|
|
|
// Example: ["unused_binding", "unused_with"]
|
|
|
|
"ignored": [],
|
|
|
|
// Files to exclude from showing diagnostics. Useful for generated files.
|
|
|
|
// It accepts an array of paths. Relative paths are joint to the workspace root.
|
|
|
|
// Glob patterns are currently not supported.
|
|
|
|
// Type: [string]
|
|
|
|
// Example: ["Cargo.nix"]
|
|
|
|
"excludedFiles": [],
|
|
|
|
},
|
2023-01-27 23:32:41 +03:00
|
|
|
"nix": {
|
|
|
|
// The path to the `nix` binary.
|
|
|
|
// Type: string
|
|
|
|
// Example: "/run/current-system/sw/bin/nix"
|
|
|
|
"binary": "nix",
|
|
|
|
},
|
2022-11-25 18:41:09 +03:00
|
|
|
},
|
|
|
|
}
|
|
|
|
```
|