mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Update Ale.
This commit is contained in:
@ -11,10 +11,7 @@ function! ale_linters#html#angular#GetProjectRoot(buffer) abort
|
||||
endfunction
|
||||
|
||||
function! ale_linters#html#angular#GetExecutable(buffer) abort
|
||||
return ale#path#FindExecutable(a:buffer, 'html_angular', [
|
||||
\ 'node_modules/@angular/language-server/bin/ngserver',
|
||||
\ 'node_modules/@angular/language-server/index.js',
|
||||
\])
|
||||
return 'node'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#html#angular#GetCommand(buffer) abort
|
||||
@ -34,9 +31,16 @@ function! ale_linters#html#angular#GetCommand(buffer) abort
|
||||
\ fnamemodify(l:language_service_dir, ':h:h')
|
||||
\ . '/typescript'
|
||||
\)
|
||||
let l:executable = ale_linters#html#angular#GetExecutable(a:buffer)
|
||||
let l:script = ale#path#FindExecutable(a:buffer, 'html_angular', [
|
||||
\ 'node_modules/@angular/language-server/bin/ngserver',
|
||||
\ 'node_modules/@angular/language-server/index.js',
|
||||
\])
|
||||
|
||||
return ale#node#Executable(a:buffer, l:executable)
|
||||
if !filereadable(l:script)
|
||||
return ''
|
||||
endif
|
||||
|
||||
return ale#Escape('node') . ' ' . ale#Escape(l:script)
|
||||
\ . ' --ngProbeLocations ' . ale#Escape(l:language_service_dir)
|
||||
\ . ' --tsProbeLocations ' . ale#Escape(l:typescript_dir)
|
||||
\ . ' --stdio'
|
||||
|
5
sources_non_forked/ale/ale_linters/html/cspell.vim
Normal file
5
sources_non_forked/ale/ale_linters/html/cspell.vim
Normal file
@ -0,0 +1,5 @@
|
||||
scriptencoding utf-8
|
||||
" Author: David Houston <houstdav000>
|
||||
" Description: cspell support for HTML files.
|
||||
|
||||
call ale#handlers#cspell#DefineLinter('html')
|
16
sources_non_forked/ale/ale_linters/html/vscodehtml.vim
Normal file
16
sources_non_forked/ale/ale_linters/html/vscodehtml.vim
Normal file
@ -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'),
|
||||
\})
|
Reference in New Issue
Block a user