From ddcd9e6aae50d6397e43e4fc9ba0cf7a82cc79de Mon Sep 17 00:00:00 2001 From: Hirokazu Hata Date: Sun, 6 Sep 2020 17:49:21 +0900 Subject: Rename nvim_lsp to lspconfig --- lua/lspconfig/rust_analyzer.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lua/lspconfig/rust_analyzer.lua (limited to 'lua/lspconfig/rust_analyzer.lua') diff --git a/lua/lspconfig/rust_analyzer.lua b/lua/lspconfig/rust_analyzer.lua new file mode 100644 index 00000000..2d545517 --- /dev/null +++ b/lua/lspconfig/rust_analyzer.lua @@ -0,0 +1,27 @@ +local configs = require 'lspconfig/configs' +local util = require 'lspconfig/util' + +configs.rust_analyzer = { + default_config = { + cmd = {"rust-analyzer"}; + filetypes = {"rust"}; + root_dir = util.root_pattern("Cargo.toml", "rust-project.json"); + settings = { + ["rust-analyzer"] = {} + } + }; + docs = { + package_json = "https://raw.githubusercontent.com/rust-analyzer/rust-analyzer/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 [docs](https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user#settings) for extra settings. + ]]; + default_config = { + root_dir = [[root_pattern("Cargo.toml", "rust-project.json")]]; + }; + }; +}; +-- vim:et ts=2 sw=2 -- cgit v1.2.3-70-g09d2