nvim: after/ftplugin/purescript: Add PureScript LSP support
This commit is contained in:
parent
d1f66f1b13
commit
39900dd9a7
2 changed files with 30 additions and 0 deletions
|
@ -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,
|
||||
})
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue