summaryrefslogtreecommitdiff
path: root/ale_linters/html/vscodehtml.vim
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/html/vscodehtml.vim
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/html/vscodehtml.vim')
-rw-r--r--ale_linters/html/vscodehtml.vim16
1 files changed, 16 insertions, 0 deletions
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'),
+\})