Fix imported files path lookup on less#lessc linter
Ale saves a temporary file (%t) which does not share the same path as the original file, breaking import statements with relative URLs. This fix sends content to `lessc` over stdin and adds the current file (%s) as one of the included paths, so statements like `@import '../utils' will correctly resolve based on the current file path.
This commit is contained in:
parent
7ed82ab712
commit
4bc31fcd18
@ -4,10 +4,10 @@
|
|||||||
call ale#Set('less_lessc_options', '')
|
call ale#Set('less_lessc_options', '')
|
||||||
|
|
||||||
function! ale_linters#less#lessc#GetCommand(buffer) abort
|
function! ale_linters#less#lessc#GetCommand(buffer) abort
|
||||||
return 'lessc'
|
return 'cat %t | lessc'
|
||||||
\ . ' --no-color --lint'
|
\ . ' --no-color --lint --include-path=' . expand('%:p:h')
|
||||||
\ . ' ' . ale#Var(a:buffer, 'less_lessc_options')
|
\ . ' ' . ale#Var(a:buffer, 'less_lessc_options')
|
||||||
\ . ' %t'
|
\ . ' -'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#less#lessc#Handle(buffer, lines) abort
|
function! ale_linters#less#lessc#Handle(buffer, lines) abort
|
||||||
|
Loading…
Reference in New Issue
Block a user