onivim / oni

Oni: Modern Modal Editing - powered by Neovim
https://www.onivim.io
MIT License
11.36k stars 301 forks source link

ALE plugin doesn't fix buffer #2713

Closed TiuSh closed 5 years ago

TiuSh commented 5 years ago

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:

Actual behavior:

Steps to reproduce:

oni-bot[bot] commented 5 years ago

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.

TiuSh commented 5 years ago

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>>>
TiuSh commented 5 years ago

Actually, it's definitely linked to NVM:

:!node -v
zsh:1: command not found: node

shell returned 127
TiuSh commented 5 years ago

Nevermind, I simply fixed my issue, that was just related to NVM, by moving NVM initialization script to my ~/.zshenv file...