mirror of
https://github.com/kossLAN/nvim-flake.git
synced 2025-11-04 17:59:50 -05:00
ftplugin: add dart lsp
This commit is contained in:
parent
725b32dbcd
commit
94f0bf1c95
2 changed files with 19 additions and 0 deletions
|
|
@ -109,6 +109,7 @@ with final.pkgs.lib; let
|
||||||
typescript-language-server # css lsp thing
|
typescript-language-server # css lsp thing
|
||||||
qt6.qtdeclarative # qmlls
|
qt6.qtdeclarative # qmlls
|
||||||
omnisharp-roslyn # c# lsp
|
omnisharp-roslyn # c# lsp
|
||||||
|
dart # dart lsp
|
||||||
|
|
||||||
# autoformatters
|
# autoformatters
|
||||||
alejandra # amazing nix autoformatter
|
alejandra # amazing nix autoformatter
|
||||||
|
|
|
||||||
18
nvim/ftplugin/dart.lua
Normal file
18
nvim/ftplugin/dart.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
-- Exit if the language server isn't available
|
||||||
|
if vim.fn.executable('dart') ~= 1 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local root_files = {
|
||||||
|
'.git',
|
||||||
|
}
|
||||||
|
|
||||||
|
local lsp = require('user.lsp')
|
||||||
|
|
||||||
|
vim.lsp.start {
|
||||||
|
name = 'dartls',
|
||||||
|
cmd = { 'dart', 'language-server', '--protocol=lsp' },
|
||||||
|
root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]),
|
||||||
|
capabilities = lsp.make_client_capabilities(),
|
||||||
|
on_attach = lsp.on_attach,
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue