-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration with ALE? #51
Comments
Maybe you could check out the configuration of |
I think this is the final straw in moving to neovim. This and the latest advancements with tree-sitter and scala. |
Note that |
Managed to get this working, thanks to @oxalica for pointing me in the right direction. call ale#Set('nix_nil_exec', 'nil')
call ale#Set('nix_nil_config', {})
function! ale_linters#nix#nil#GetCommand(buffer) abort
return '%e'
endfunction
function! ale_linters#nix#nil#GetProjectRoot(buffer) abort
let l:flake_file = ale#path#FindNearestFile(a:buffer, 'flake.nix')
return !empty(l:flake_file) ? fnamemodify(l:flake_file, ':h') : ''
endfunction
call ale#linter#Define('nix', {
\ 'name': 'nil',
\ 'lsp': 'stdio',
\ 'lsp_config': {b -> ale#Var(b, 'nix_nil_config')},
\ 'executable': {b -> ale#Var(b, 'nix_nil_exec')},
\ 'command': function('ale_linters#nix#nil#GetCommand'),
\ 'project_root': function('ale_linters#nix#nil#GetProjectRoot'),
\}) and I've just added nil to my list of nix linters. Edit: had a look at some of the go lsp's, they use .git location as their backup, but i think that would be perfect for the primary here. I'll use this for like a week and if nobody has any comments I'll make a PR to get this into ale. call ale#Set('nix_nil_exec', 'nil')
call ale#Set('nix_nil_config', {})
function! ale_linters#nix#nil#GetCommand(buffer) abort
return '%e'
endfunction
function! ale_linters#nix#nil#GetProjectRoot(buffer) abort
let l:git_root = ale#path#FindNearestDirectory(a:buffer, '.git')
return !empty(l:git_root) ? fnamemodify(l:git_root, ':h') : ''
endfunction
call ale#linter#Define('nix', {
\ 'name': 'nil',
\ 'lsp': 'stdio',
\ 'lsp_config': {b -> ale#Var(b, 'nix_nil_config')},
\ 'executable': {b -> ale#Var(b, 'nix_nil_exec')},
\ 'command': function('ale_linters#nix#nil#GetCommand'),
\ 'project_root': function('ale_linters#nix#nil#GetProjectRoot'),
\})
|
Hi @SamuelKurtzer -- I don't see any PR for nil over there https://github.com/dense-analysis/ale/pulls?is%3Apr+nil , have you had a chance to find time to do it? (just looking at nix linters landscape and was wondering what to use at this point and wondered about this. I'm not above manually adding this file, but it'll benefit everyone if it were merged upstream) |
I tried my best to get this working with A.L.E in vim and I'm having trouble. I can't seem to get past a simple errors in ALE.
I also tried using
nil
as the command but that didn't work either. I feel like I'm missing something extremely basic.The text was updated successfully, but these errors were encountered: