123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- vim.diagnostic.config({
- -- only show virtual text for WARN and higher
- virtual_text = { severity = { min = vim.diagnostic.severity.WARN } },
- })
- vim.lsp.config('*', {
- capabilities = require('cmp_nvim_lsp').default_capabilities(),
- })
- vim.lsp.enable("bashls");
- vim.lsp.enable("eslint");
- if vim.fn.executable("dprint") == 1 then
- local version = vim.version.parse(vim.fn.system("dprint --version"))
- if vim.version.cmp(version, {0,45,0}) >= 0 then
- vim.lsp.enable("dprint")
- end
- end
- if vim.fn.executable("deno") == 1 then
- vim.lsp.enable("deno");
- else
- require('typescript').setup({
- server = {
- init_options = {
- completionDisableFilterText = true,
- preferences = {
- importModuleSpecifierPreference = 'non-relative',
- -- this prevents renames from aliasing when destructuring
- providePrefixAndSuffixTextForRename = false,
- },
- },
- handlers = {
- ['$/typescriptVersion'] = function(err, result, ctx, config)
- vim.notify(string.format('Typescript %s', result.version))
- end
- },
- flags = {
- debounce_text_changes = 150,
- },
- on_init = function(client)
- -- mark tsserver as not having formatting available as we rely on
- -- eslint and dprint for that
- client.server_capabilities.documentFormattingProvider = false
- client.server_capabilities.documentRangeFormattingProvider = false
- end,
- }
- })
- end
- if vim.fn.executable("gopls") == 1 then
- vim.lsp.enable("gopls")
- end
- if vim.fn.executable("ruby-lsp") == 1 then
- vim.lsp.config("ruby_lsp", {
- init_options = {
- enabledFeatures = {
- formatting = false,
- },
- }
- })
- vim.lsp.enable("ruby_lsp")
- end
- if vim.fn.executable("nil") == 1 then
- vim.lsp.enable("nil_ls")
- end
- if vim.fn.executable("jdtls") == 1 then
- vim.lsp.config("jdtls", {
- handlers = {
- ["$/progress"] = function()
- -- this is quite noisy so just disable it
- end
- },
- })
- vim.lsp.enable("jdtls")
- end
- -- custom LSP servers
- vim.lsp.config("elvish", {
- cmd = {'elvish', '--lsp'},
- filetypes = {'elvish'},
- settings = {},
- })
- vim.lsp.enable("elvish")
|