Hello! I am a new user of ale, I noticed the work done on #571, and have started trying to use it. I'm running into issues when trying to run it on save (which is being tackled by #570), but figured I might as well ask in case it is due to user error.
Here are my configs:
let g:ale_fixers = {}
let g:ale_fixers.javascript = [
\ 'prettier',
\ 'eslint',
\]
let g:ale_javascript_prettier_options = ' --stdin\ --parser\ flow\ --single-quote\ --trailing-comma\ all\ --no-bracket-spacing'
autocmd BufWrite *.js ALEFix
I'm noticing a few things:
:wq.Is this due to some async feature of ale? I previously used neoformat to do something similar, for which this doesn't occur.
when specifying ale_fixers for javascript, if I change the order of eslint and prettier so that eslint comes before prettier, the javascript_prettier_options don't get applied.
If I don't specify ale_javascript_prettier_options, ALEFix runs into an error
Error detected while processing function ale#fix#Fix[21]..<SNR>213_RunFixer[6]..ale#handlers#prettier#Fix[1]..ale#Var:
line 3:
E716: Key not present in Dictionary: ale_javascript_prettier_options
E116: Invalid arguments for function getbufvar(str2nr(a:buffer), l:full_name, g:[l:full_name])
E15: Invalid expression: getbufvar(str2nr(a:buffer), l:full_name, g:[l:full_name])
Thank you for doing such amazing work!
You can't accomplish this with a simple autocmd on BufWrite. I will add support for this eventually.
The jobs for fixing files run asynchronously, so eslint and prettier will stop executing _after_ the file has already been closed. I need to change the code so it can be used for writing changes back to the file on disk, even if the buffer is no longer open.
I'll have to make a note to change ale#Var so it can look up buffer variables from a Dictionary which is saved for fixing files if the buffer is closed before fixing is completed.
This is supported with an option now. See :help g:ale_fix_on_save.
wow, thank you for the incredibly quick turnaround!
Not sure if this can be fixed but when I do a :wq in NeoVim I get these errors:
Error detected while processing function <SNR>99_NeoVimCallback[29]..<SNR>106_HandleExit:
line 13:
E484: Can't open file /var/folders/nc/1y1czqf96736xppxnnkmgkrc0000gn/T/nvimrSHvON/6/keyword_args.rb
Please open a new issue with steps for repeating the bug.
Most helpful comment
This is supported with an option now. See
:help g:ale_fix_on_save.