aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorcsmoe <csmoe@msn.com>2019-11-26 22:22:08 +0800
committerAshkan Kiani <ashkan.k.kiani@gmail.com>2019-11-26 06:22:08 -0800
commit298a307f36df6d1cb6fd5f84815da9e15e05b85d (patch)
treeffdcc105121bc223b671625d8dc892e429a7f749 /lua
parent[docgen] Update README.md (diff)
downloadnvim-lspconfig-298a307f36df6d1cb6fd5f84815da9e15e05b85d.tar
nvim-lspconfig-298a307f36df6d1cb6fd5f84815da9e15e05b85d.tar.gz
nvim-lspconfig-298a307f36df6d1cb6fd5f84815da9e15e05b85d.tar.bz2
nvim-lspconfig-298a307f36df6d1cb6fd5f84815da9e15e05b85d.tar.lz
nvim-lspconfig-298a307f36df6d1cb6fd5f84815da9e15e05b85d.tar.xz
nvim-lspconfig-298a307f36df6d1cb6fd5f84815da9e15e05b85d.tar.zst
nvim-lspconfig-298a307f36df6d1cb6fd5f84815da9e15e05b85d.zip
Add support for rust-analyzer (#43)
* add support for rust-analyzer * add rust-analyzer package json
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim_lsp.lua1
-rw-r--r--lua/nvim_lsp/rust_analyzer.lua28
2 files changed, 29 insertions, 0 deletions
diff --git a/lua/nvim_lsp.lua b/lua/nvim_lsp.lua
index 13e27020..82c303f7 100644
--- a/lua/nvim_lsp.lua
+++ b/lua/nvim_lsp.lua
@@ -12,6 +12,7 @@ require 'nvim_lsp/hie'
require 'nvim_lsp/leanls'
require 'nvim_lsp/pyls'
require 'nvim_lsp/rls'
+require 'nvim_lsp/rust_analyzer'
require 'nvim_lsp/solargraph'
require 'nvim_lsp/sumneko_lua'
require 'nvim_lsp/texlab'
diff --git a/lua/nvim_lsp/rust_analyzer.lua b/lua/nvim_lsp/rust_analyzer.lua
new file mode 100644
index 00000000..648663bf
--- /dev/null
+++ b/lua/nvim_lsp/rust_analyzer.lua
@@ -0,0 +1,28 @@
+local skeleton = require 'nvim_lsp/skeleton'
+local util = require 'nvim_lsp/util'
+local lsp = vim.lsp
+
+skeleton.rust_analyzer = {
+ default_config = util.utf8_config {
+ cmd = {"ra_lsp_server"};
+ filetypes = {"rust"};
+ root_dir = util.root_pattern("Cargo.toml");
+ log_level = lsp.protocol.MessageType.Warning;
+ settings = {};
+ };
+ docs = {
+ package_json = "https://github.com/rust-analyzer/rust-analyzer/raw/master/editors/code/package.json";
+ description = [[
+https://github.com/rust-analyzer/rust-analyzer
+
+rust-analyzer(aka rls 2.0), a language server for Rust
+
+See below for rls specific settings.
+https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user#settings
+ ]];
+ default_config = {
+ root_dir = [[root_pattern("Cargo.toml")]];
+ };
+ };
+};
+-- vim:et ts=2 sw=2