mirror of
https://github.com/dense-analysis/ale
synced 2024-12-23 14:45:29 +00:00
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', '')
|
||||
|
||||
function! ale_linters#less#lessc#GetCommand(buffer) abort
|
||||
return 'lessc'
|
||||
\ . ' --no-color --lint'
|
||||
return 'cat %t | lessc'
|
||||
\ . ' --no-color --lint --include-path=' . expand('%:p:h')
|
||||
\ . ' ' . ale#Var(a:buffer, 'less_lessc_options')
|
||||
\ . ' %t'
|
||||
\ . ' -'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#less#lessc#Handle(buffer, lines) abort
|
||||
|
Loading…
Reference in New Issue
Block a user