diff options
| author | moxie <moxie.git@posteo.net> | 2025-09-30 12:27:44 +0300 |
|---|---|---|
| committer | moxie <moxie.git@posteo.net> | 2025-09-30 12:27:44 +0300 |
| commit | 1e27d1c7b25e4d28a25c0fa2c4e6e33a66b9072e (patch) | |
| tree | 7169509b4d5dfce3ed25fe333cc506a40f5c90f2 /.config/nvim/lsp/rust_analyzer.lua | |
| parent | 51797f743fe74d1723ca62085f92e8c5e953038b (diff) | |
add nvim configs
Diffstat (limited to '.config/nvim/lsp/rust_analyzer.lua')
| -rw-r--r-- | .config/nvim/lsp/rust_analyzer.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/.config/nvim/lsp/rust_analyzer.lua b/.config/nvim/lsp/rust_analyzer.lua new file mode 100644 index 0000000..df5c1de --- /dev/null +++ b/.config/nvim/lsp/rust_analyzer.lua @@ -0,0 +1,19 @@ +return { + cmd = { "rust-analyzer" }, + filetypes = { "rust" }, + root_markers = { "Cargo.toml", ".git" }, + single_file_support = true, + capabilities = { + experimental = { + serverStatusNotification = true, + }, + }, + before_init = function(init_params, config) + -- See https://github.com/rust-lang/rust-analyzer/blob/eb5da56d839ae0a9e9f50774fa3eb78eb0964550/docs/dev/lsp-extensions.md?plain=1#L26 + if config.settings and config.settings['rust-analyzer'] then + init_params.initializationOptions = config.settings['rust-analyzer'] + end + end, +} + +-- cmd = { "socat", "-", "UNIX-CONNECT:/tmp/rust-analyzer.sock" }, |
