summaryrefslogtreecommitdiff
path: root/nvim/lua/config/lsp.lua
blob: 91c91032d15552d2afff1fc992c92380607e24d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
-- LSP diagnostic info config (erorrs, warnings, etc.)
vim.diagnostic.config({
	-- use virtual text to show diagnostic messages
  virtual_text = true,
})

-- requires vscode-json-languageserver
vim.lsp.enable('jsonls')
vim.lsp.config('jsonls', {
	settings = {
		json = {
			schemas = require('schemastore').json.schemas {
				select = {
					'tsconfig.json',
					'package.json',
					'prettierrc.json',
					'.eslintrc',
				}
			},
			validate = { enable = true },
		},
	},
})

-- requires bash-language-server, shellcheck is a nice optional addition
vim.lsp.enable('bashls')

-- dymanic path to bitbucket config schema
local bb_schema_path = vim.fn.stdpath("config") .. "/bitbucket-pipelines.json"

-- npm i -g yaml-language-server
vim.lsp.enable('yamlls')
vim.lsp.config('yamlls', {
	settings = {
		yaml = {
			schemas = require('schemastore').yaml.schemas {
				replace = {
					['bitbucket-pipelines'] = {
						description = 'Patched pipelines schema',
						name = 'bitbucket-pipelines',
						fileMatch = 'bitbucket-pipelines.yml',
						url = 'file://' .. bb_schema_path,
					}
				}
			},
		}
	}
})

-- requires clang installed
vim.lsp.enable('clangd')
vim.lsp.enable('eslint')
vim.lsp.enable('cssls')
-- requires typescript-language-server
vim.lsp.enable('ts_ls')
-- requires jdtls (AUR) and mfussenegger/nvim-jdtls plugin
vim.lsp.enable('jdtls')