summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
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'),
\})