Skip to content
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

Components do not render upon startup in JS files. #17

Open
superDross opened this issue May 1, 2019 · 4 comments
Open

Components do not render upon startup in JS files. #17

superDross opened this issue May 1, 2019 · 4 comments

Comments

@superDross
Copy link

When opening a JS file with a pre-existing error/warning the lightline-ale components do not render. However, when I intentionally make an error said components pop up and remain.

The below gif demonstrates this.

ale_tsserver_delay

I am using eslint as a linter and tsserver as an LSP in ALE.

@maximbaz
Copy link
Owner

maximbaz commented May 3, 2019

Hey! I'm not using this plugin anymore, but I can assist you in investigating this issue 😉

This plugin subscribes to the following ALE events:

autocmd User ALEJobStarted call lightline#update()
autocmd User ALELintPost call lightline#update()
autocmd User ALEFixPost call lightline#update()

So either ALE itself is not triggering these events when you first open vim, or there's another event that we have to subscribe.

As a workaround, I think you can also manually call lightline#update() in your vimrc 🙂

@superDross
Copy link
Author

Thanks for helping out. Why do you no longer use this plugin?

So there seems to be some new events added to ALE and I have added them to the auto command group. However, it didn't resolve the issue.

  augroup lightline#ale
    autocmd!
    autocmd User ALEJobStarted call lightline#update()
    autocmd User ALELintPre call lightline#update()
    autocmd User ALELintPost call lightline#update()
    autocmd User ALEFixPre call lightline#update()
    autocmd User ALEFixPost call lightline#update()
 augroup END

Calling :call lightline#update() after startup does not resolve the issue. However, calling :ALELint after startup does cause the linting errors to render within the statusline. It only works when you execute after the warning/error sign have appeared within the gutter though. So setting autocmd VimEnter *.js :ALELint in my vimrc does not work.

I am not really sure where to go from here. I guess being able to automatically execute :ALELint 3 seconds after starting up vim in a *.js file would fix it but I don't know how to do this and it isn't a very clean solution.

@maximbaz
Copy link
Owner

maximbaz commented May 7, 2019

The reason I'm not using this plugin is because I switched from vim/nvim to kakoune.

These events you mention are not new, it only makes sense to update lightline after lint or fix operation, not before. This is why additionally registering to these events it didn't solve the issue.

Is the issue only reproducible for javascript files? It might be some issue in the ALE itself, try to create an issue on their side explaining why you expect that :ALELint should be executed on startup and ask them why it doesn't happen. And cross-link the threads 🙂

@neozenith
Copy link
Contributor

@superDross I still use this plugin daily. So I’ll take this issue from Maxim. But I promise no turn around time smaller than weeks-months. Just when I get on my next dotfile polishing session.

I wonder if it happens with the python files I’m using too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants