summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorDalius Dobravolskas <dalius.dobravolskas@gmail.com>2022-05-02 13:42:24 +0300
committerGitHub <noreply@github.com>2022-05-02 19:42:24 +0900
commit56399106fcf9d80d476307576bc307e67f0167e2 (patch)
tree0a66e044096af24c8b685a0d9a5c619d6f57bbca /ale_linters
parent34892186e44b21356c84e1c2e019f96a304c3edc (diff)
downloadale-56399106fcf9d80d476307576bc307e67f0167e2.zip
VSCode LSPs for CSS, HTML and JSON (#4175)
Switched to `vscode-langservers-extracted` as it is the one most up-to-date.
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/css/vscodecss.vim16
-rw-r--r--ale_linters/html/vscodehtml.vim16
-rw-r--r--ale_linters/json/vscodejson.vim4
3 files changed, 34 insertions, 2 deletions
diff --git a/ale_linters/css/vscodecss.vim b/ale_linters/css/vscodecss.vim
new file mode 100644
index 00000000..2d59adf0
--- /dev/null
+++ b/ale_linters/css/vscodecss.vim
@@ -0,0 +1,16 @@
+" Author: Dalius Dobravolskas <dalius.dobravolskas@gmail.com>
+" Description: VSCode css language server
+
+function! ale_linters#css#vscodecss#GetProjectRoot(buffer) abort
+ let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
+
+ return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
+endfunction
+
+call ale#linter#Define('css', {
+\ 'name': 'vscodecss',
+\ 'lsp': 'stdio',
+\ 'executable': 'vscode-css-language-server',
+\ 'command': '%e --stdio',
+\ 'project_root': function('ale_linters#css#vscodecss#GetProjectRoot'),
+\})
diff --git a/ale_linters/html/vscodehtml.vim b/ale_linters/html/vscodehtml.vim
new file mode 100644
index 00000000..46814a0b
--- /dev/null
+++ b/ale_linters/html/vscodehtml.vim
@@ -0,0 +1,16 @@
+" Author: Dalius Dobravolskas <dalius.dobravolskas@gmail.com>
+" Description: VSCode html language server
+
+function! ale_linters#html#vscodehtml#GetProjectRoot(buffer) abort
+ let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
+
+ return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
+endfunction
+
+call ale#linter#Define('html', {
+\ 'name': 'vscodehtml',
+\ 'lsp': 'stdio',
+\ 'executable': 'vscode-html-language-server',
+\ 'command': '%e --stdio',
+\ 'project_root': function('ale_linters#html#vscodehtml#GetProjectRoot'),
+\})
diff --git a/ale_linters/json/vscodejson.vim b/ale_linters/json/vscodejson.vim
index 91988923..dcaee010 100644
--- a/ale_linters/json/vscodejson.vim
+++ b/ale_linters/json/vscodejson.vim
@@ -1,5 +1,5 @@
" Author: Dalius Dobravolskas <dalius.dobravolskas@gmail.com>
-" Description: VSCode json languageserver
+" Description: VSCode json language server
function! ale_linters#json#vscodejson#GetProjectRoot(buffer) abort
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
@@ -10,7 +10,7 @@ endfunction
call ale#linter#Define('json', {
\ 'name': 'vscodejson',
\ 'lsp': 'stdio',
-\ 'executable': 'vscode-json-languageserver',
+\ 'executable': 'vscode-json-language-server',
\ 'command': '%e --stdio',
\ 'project_root': function('ale_linters#json#vscodejson#GetProjectRoot'),
\})