ALE plugin doesn't fix buffer
Oni Version: 0.3.9 Neovim Version: 0.3.1 Operating System: MacOS 10.14.2
Issue: After updating Oni to the latest release, ALE plugin stopped working... Using a minimal config file:
// ~/.config/oni/config.tsx
export const configuration = {
"oni.useDefaultConfig": false,
"oni.loadInitVim": "~/.config/oni/init.vim",
}
" ~/.config/oni/init.vim
set nocompatible
call plug#begin('~/.config/oni/plugged')
Plug 'leafgarland/typescript-vim'
Plug 'w0rp/ale'
call plug#end()
let g:ale_fix_on_save = 1
let g:ale_linters = {
\ 'typescript': ['tslint', 'tsserver', 'prettier'],
\ }
let g:ale_fixers = {
\ 'typescript': ['tslint', 'prettier'],
\ }
with this sandbox repo https://github.com/TiuSh/oni-sandbox it works as expected with Neovim, but doesn't work anymore with Oni...
Expected behavior:
- Opening
index.tsfile should show an error on first line - When saving file, the first line should be automatically fixed by ALE:
- const value: number = 42;
+ const value = 42;
Actual behavior:
- There's no error on first line
- When saving file, nothing changes
Steps to reproduce:
- Checkout https://github.com/TiuSh/oni-sandbox.git
- Run
yarn - Open
index.tsfile with Oni, and save it
Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.
I found this in the logs from ALE (with :ALEInfo):
(finished - exit code 127) ['/bin/zsh', '-c', '''/Users/tiush/Code/oni-sandbox/node_modules/.bin/tslint'' -c ''/Users/tiush/Code/oni-sandbox/tslint.json'' --fix ''/var/folders/jc/n7st77fn1rd0rllc_mgm0b3w0000gn/T/nvimoOKIJS/4/index.ts''']
(finished - exit code 127) ['/bin/zsh', '-c', '''/Users/tiush/Code/oni-sandbox/node_modules/.bin/prettier'' --version']
(finished - exit code 127) ['/bin/zsh', '-c', '''/Users/tiush/Code/oni-sandbox/node_modules/.bin/prettier'' ''/var/folders/jc/n7st77fn1rd0rllc_mgm0b3w0000gn/T/nvimoOKIJS/5/index.ts'' --write']
(finished - exit code 127) ['/bin/zsh', '-c', 'cd ''/Users/tiush/Code/oni-sandbox'' && ''/Users/tiush/Code/oni-sandbox/node_modules/.bin/tslint'' --format json -c ''/Users/tiush/Code/oni-sandbox/tslint.json'' ''/var/folders/jc/n7st77fn1rd0rllc_mgm0b3w0000gn/T/nvimoOKIJS/6/index.ts''']
<<<NO OUTPUT RETURNED>>>
After a little digging I found it could be linked to the fact that I also moved to NVM: https://github.com/w0rp/ale/issues/1666
But adding set shellcmdflag=-lc to my init.vim didn't fix my issue:
(finished - exit code 127) ['/bin/zsh', '-lc', '''/Users/tiush/Code/oni-sandbox/node_modules/.bin/tslint'' -c ''/Users/tiush/Code/oni-sandbox/tslint.json'' --fix ''/var/folders/jc/n7st77fn1rd0rllc_mgm0b3w0000gn/T/nvimyakkZN/4/index.ts''']
(finished - exit code 127) ['/bin/zsh', '-lc', '''/Users/tiush/Code/oni-sandbox/node_modules/.bin/prettier'' --version']
(finished - exit code 127) ['/bin/zsh', '-lc', '''/Users/tiush/Code/oni-sandbox/node_modules/.bin/prettier'' ''/var/folders/jc/n7st77fn1rd0rllc_mgm0b3w0000gn/T/nvimyakkZN/5/index.ts'' --write']
(finished - exit code 127) ['/bin/zsh', '-lc', 'cd ''/Users/tiush/Code/oni-sandbox'' && ''/Users/tiush/Code/oni-sandbox/node_modules/.bin/tslint'' --format json -c ''/Users/tiush/Code/oni-sandbox/tslint.json'' ''/var/folders/jc/n7st77fn1rd0rllc_mgm0b3w0000gn/T/nvimyakkZN/6/index.ts''']
<<<NO OUTPUT RETURNED>>>
Actually, it's definitely linked to NVM:
:!node -v
zsh:1: command not found: node
shell returned 127
Nevermind, I simply fixed my issue, that was just related to NVM, by moving NVM initialization script to my ~/.zshenv file...