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