diff options
| author | Michael Lingelbach <m.j.lbach@gmail.com> | 2020-12-31 21:01:13 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-31 21:01:13 -0800 |
| commit | 64df0ad415ebb8687d3633372948052f39ebc6eb (patch) | |
| tree | 548d5a58b96f0670f2e7ec1f8e8a261ec24a5c2d /lua | |
| parent | [docgen] Update README.md (diff) | |
| parent | [docgen] Update README.md (diff) | |
| download | nvim-lspconfig-64df0ad415ebb8687d3633372948052f39ebc6eb.tar nvim-lspconfig-64df0ad415ebb8687d3633372948052f39ebc6eb.tar.gz nvim-lspconfig-64df0ad415ebb8687d3633372948052f39ebc6eb.tar.bz2 nvim-lspconfig-64df0ad415ebb8687d3633372948052f39ebc6eb.tar.lz nvim-lspconfig-64df0ad415ebb8687d3633372948052f39ebc6eb.tar.xz nvim-lspconfig-64df0ad415ebb8687d3633372948052f39ebc6eb.tar.zst nvim-lspconfig-64df0ad415ebb8687d3633372948052f39ebc6eb.zip | |
Merge pull request #481 from mjlbach/fix_rust-analyzer_nightly
Fix rust analyzer nightly
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/rust_analyzer.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lua/lspconfig/rust_analyzer.lua b/lua/lspconfig/rust_analyzer.lua index 2d545517..12bcfbae 100644 --- a/lua/lspconfig/rust_analyzer.lua +++ b/lua/lspconfig/rust_analyzer.lua @@ -1,6 +1,17 @@ local configs = require 'lspconfig/configs' local util = require 'lspconfig/util' +-- neovim doesn't support the full 3.16 spec, but latest rust-analyzer requires the following capabilities. +-- Remove once implemented. +local default_capabilities = vim.lsp.protocol.make_client_capabilities() +default_capabilities.workspace.workspaceEdit = { + normalizesLineEndings = true; + changeAnnotationSupport = { + groupsOnLabel = true; + }; +}; +default_capabilities.textDocument.rename.prepareSupportDefaultBehavior = 1; + configs.rust_analyzer = { default_config = { cmd = {"rust-analyzer"}; @@ -8,7 +19,8 @@ configs.rust_analyzer = { root_dir = util.root_pattern("Cargo.toml", "rust-project.json"); settings = { ["rust-analyzer"] = {} - } + }; + capabilities = default_capabilities; }; docs = { package_json = "https://raw.githubusercontent.com/rust-analyzer/rust-analyzer/master/editors/code/package.json"; |
