diff options
| author | tms <nemi@skaut.cz> | 2020-02-07 17:42:30 +0100 |
|---|---|---|
| committer | tms <nemi@skaut.cz> | 2020-02-07 17:42:30 +0100 |
| commit | 05929dd113c573198311651d21739c7ad42dfc4c (patch) | |
| tree | 6ffa383afc9de5168a334c3fe9f9ac2e18850cbd /lua | |
| parent | clangd: fix root_dir problem #114 (diff) | |
| download | nvim-lspconfig-05929dd113c573198311651d21739c7ad42dfc4c.tar nvim-lspconfig-05929dd113c573198311651d21739c7ad42dfc4c.tar.gz nvim-lspconfig-05929dd113c573198311651d21739c7ad42dfc4c.tar.bz2 nvim-lspconfig-05929dd113c573198311651d21739c7ad42dfc4c.tar.lz nvim-lspconfig-05929dd113c573198311651d21739c7ad42dfc4c.tar.xz nvim-lspconfig-05929dd113c573198311651d21739c7ad42dfc4c.tar.zst nvim-lspconfig-05929dd113c573198311651d21739c7ad42dfc4c.zip | |
Add dartls lua script
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim_lsp/dartls.lua | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/lua/nvim_lsp/dartls.lua b/lua/nvim_lsp/dartls.lua new file mode 100644 index 00000000..f20e5dfa --- /dev/null +++ b/lua/nvim_lsp/dartls.lua @@ -0,0 +1,42 @@ +local nvim_lsp = require 'nvim_lsp' +local configs = require 'nvim_lsp/configs' +local lsp = vim.lsp + +local server_name = "dartls" +local bin_name = "dart" +local dart_sdk_path = os.getenv("DART_SDK") + +configs[server_name] = { + default_config = { + cmd = {"dart", dart_sdk_path .. "/bin/snapshots/analysis_server.dart.snapshot", "--lsp"}; + filetypes = {"dart"}; + root_dir = nvim_lsp.util.root_pattern("pubspec.yaml"); + log_level = lsp.protocol.MessageType.Warning; + init_options = { + onlyAnalyzeProjectsWithOpenFiles = "false", + suggestFromUnimportedLibraries = "true", + closingLabels = "true", + outline = "true", + fluttreOutline= "false" + }; + settings = {}; + }; + docs = { + description = [[ +https://github.com/dart-lang/sdk/tree/master/pkg/analysis_server/tool/lsp_spec + +Language server for dart. +]]; + default_config = { + root_dir = "pubspec.yaml folder"; + }; + }; +}; + + +configs[server_name].install_info = function() + return { + is_installed = dart_sdk_path ~= nil + } +end + |
