From 4f289effd944a8297bf86de2a7a5aa8f59870df9 Mon Sep 17 00:00:00 2001 From: Nils Wireklint Date: Tue, 6 Dec 2022 02:43:10 +0100 Subject: feat: add 'starlark-rust' LSP for starlark and BUILD files (#2291) * feat: add 'starlark-rust' LSP for starlark and BUILD files This uses the github name and not the cargo name as it is not so official and may be replaced by a better LSP. So the name is not already taken by this linter. * fix: remove indent * fix: remove indent * fix: remove indent * fix: remove indent * fix: remove indent * fix: remove indent * fix: remove indent Co-authored-by: Raphael --- .../server_configurations/starlark-rust.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lua/lspconfig/server_configurations/starlark-rust.lua (limited to 'lua') diff --git a/lua/lspconfig/server_configurations/starlark-rust.lua b/lua/lspconfig/server_configurations/starlark-rust.lua new file mode 100644 index 00000000..36b828f1 --- /dev/null +++ b/lua/lspconfig/server_configurations/starlark-rust.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig/util' + +return { + default_config = { + cmd = { 'starlark', '--lsp' }, + filetypes = { 'star', 'bzl', 'BUILD.bazel' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/facebookexperimental/starlark-rust/ +The LSP part of `starlark-rust` is not currently documented, + but the implementation works well for linting. +This gives valuable warnings for potential issues in the code, +but does not support refactorings. + +It can be installed with cargo: https://crates.io/crates/starlark +]], + }, +} -- cgit v1.2.3-70-g09d2