From 96e7247df2b3b647e27114541930e5365041e744 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Thu, 27 Jun 2024 23:41:23 -0700 Subject: [PATCH] feat: add bazelrc-lsp config (#3224) This is the configuration for https://github.com/salesforce-misc/bazelrc-lsp, which supports `.bazelrc` configuration files. --- .../server_configurations/bazelrc-lsp.lua | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lua/lspconfig/server_configurations/bazelrc-lsp.lua diff --git a/lua/lspconfig/server_configurations/bazelrc-lsp.lua b/lua/lspconfig/server_configurations/bazelrc-lsp.lua new file mode 100644 index 0000000000..d89462a2dd --- /dev/null +++ b/lua/lspconfig/server_configurations/bazelrc-lsp.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig/util' + +return { + default_config = { + cmd = { 'bazelrc-lsp' }, + filetypes = { 'bazelrc' }, + root_dir = util.root_pattern('WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel'), + }, + docs = { + description = [[ +https://github.com/salesforce-misc/bazelrc-lsp + +`bazelrc-lsp` is a LSP for `.bazelrc` configuration files. + +The `.bazelrc` file type is not detected automatically, you can register it manually (see below) or override the filetypes: + +```lua +vim.filetype.add { + pattern = { + ['.*.bazelrc'] = 'bazelrc', + }, +} +``` +]], + }, +}