nvim: after/ftplugin/purescript: Add PureScript LSP support

This commit is contained in:
Sanchayan Maity 2023-04-21 18:46:02 +05:30
parent d1f66f1b13
commit 39900dd9a7
Signed by: sanchayanmaity
GPG Key ID: 6F6A0609C12038F3
2 changed files with 30 additions and 0 deletions

View File

@ -1,2 +1,14 @@
vim.bo.textwidth = 0
vim.bo.wrapmargin = 0
local lsp_utils = require('lsp-utils')
local puresls_config = lsp_utils.pursls_config()
vim.lsp.start(puresls_config)
vim.api.nvim_create_autocmd({ "BufReadPre", "BufWinEnter" }, {
pattern = { "*.spago/*" },
callback = function()
vim.bo.buflisted = false
end,
})

View File

@ -211,6 +211,24 @@ function M.jedi_config()
}
end
function M.pursls_config()
local root_files = { 'bower.json', 'psc-package.json', 'spago.dhall' }
local root_directory = get_root_directory(root_files)
return {
name = "purescriptls",
cmd = { 'purescript-language-server', '--stdio' },
root_dir = root_directory,
filetypes = { 'purescript' },
single_file_support = false,
settings = {
purescript = {
formatter = 'purs-tidy',
}
},
}
end
function M.ra_config()
local root_files = { "Cargo.toml" }
local root_directory = get_root_directory(root_files)