nvim: Enable LSP for gleam

This commit is contained in:
Sanchayan Maity 2024-10-20 16:22:09 +05:30
parent c39fd13c76
commit bfe01585ad
Signed by: sanchayanmaity
GPG key ID: 6F6A0609C12038F3
2 changed files with 17 additions and 0 deletions

View file

@ -0,0 +1,4 @@
local lsp_utils = require('lsp-utils')
local gleam_config = lsp_utils.gleam_config()
vim.lsp.start(gleam_config)

View file

@ -177,6 +177,19 @@ function M.elixir_config()
} }
end end
function M.gleam_config()
local root_files = { 'gleam.toml' }
local root_directory = get_root_directory(root_files)
return {
name = "gleam",
cmd = { 'gleam', 'lsp' },
capabilities = default_capabilities,
root_dir = root_directory,
filetypes = { 'gleam' },
}
end
function M.gopls_config() function M.gopls_config()
local root_files = { 'go.mod', 'go.work', '.git' } local root_files = { 'go.mod', 'go.work', '.git' }
local root_directory = get_root_directory(root_files) local root_directory = get_root_directory(root_files)