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

Add support for ALE, the Async Linting Engine #1286

Closed
wants to merge 1 commit into from
Closed

Add support for ALE, the Async Linting Engine #1286

wants to merge 1 commit into from

Conversation

neersighted
Copy link
Contributor

Ale is a plugin that lints text in the background, as you type!

It is new, but under rapid development.

@w0rp
Copy link
Contributor

w0rp commented Oct 10, 2016

This looks okay to me. I'll leave this for airline contributors to look at.

@chrisbra
Copy link
Member

could someone test this please?

@neersighted
Copy link
Contributor Author

This is currently waiting on dense-analysis/ale#97. As far as testing, it works on all my machines, but third-party tests would be great.

Ale is a plugin that lints text in the background, as you type!

It is new, but under [rapid development](https://github.com/w0rp/ale).
@neersighted
Copy link
Contributor Author

The blocker is now merged, so this is good to go again.

@chrisbra
Copy link
Member

thanks. included

@chrisbra chrisbra closed this Oct 14, 2016
@unphased
Copy link

unphased commented Mar 7, 2018

@chrisbra do you think you could give me some pointers on how to extend the ALE plugin to use the autocmd User ALELintPre and autocmd User ALELintPost autocmds to give a realtime color indicator of ALE lint job status?

I want that feedback because linting (especially c++) can sometimes bring the system to its knees. Such an indicator would help for peace of mind...

@chrisbra
Copy link
Member

chrisbra commented Mar 7, 2018

the airline plugin does not trigger the Ale linting, it only shows the result (e.g. is merely calls ale#statusline#get() function). Try asking @w0rp as it is his plugin and he did most of the airline extension.

@unphased
Copy link

unphased commented Mar 7, 2018

@chrisbra I am well aware of this. I'm referring to the autocommands run by ALE when linting proceeds. I just need documentation on basic airline section color updating, that's it...

@chrisbra
Copy link
Member

chrisbra commented Mar 7, 2018

There is nothing like a specific highlighting parts of a section. However you could use User highlighting and add some parts to the statusline (including the User highlighting group).

@unphased
Copy link

unphased commented Mar 7, 2018

I am unable to find docs on what User highlighting means. I see that it is used by these autocommands. Thanks for the help.

@unphased
Copy link

unphased commented Mar 7, 2018

Is User just like any other highlight group, and just a standard Vim placeholder one for user to customize? That's fine. I'd like to just make the warn/error section to change color.

@chrisbra
Copy link
Member

chrisbra commented Mar 7, 2018

You need to define any of the User1 till User9 highlighting group. Then in the airline section, you can use %1*text%0* to set use highlighting group User1 for text text.

@unphased
Copy link

unphased commented Mar 7, 2018

Thanks, that would have taken a loooong time for me to figure out on my own :)

So this means i can then just update the content of the section and it will change color?

@chrisbra
Copy link
Member

chrisbra commented Mar 7, 2018

Well, you either need to redefine the highlighting group or use a different one, depending on what you want.

@unphased
Copy link

unphased commented Mar 7, 2018

image

:hi User1
User1          xxx ctermbg=52 guibg=#803030

(the User1 looks the way i set it)

i'm guessing the interpretation happens somewhere so i need to put the string somewhere special

when i grep airline repo for User all i get are matches for autocommands.

@chrisbra
Copy link
Member

chrisbra commented Mar 7, 2018

ah okay, that would need to be defined differently I think. It might be simpler to just redefine airline_warning and airline_highlighting group

@unphased
Copy link

unphased commented Mar 7, 2018

I don't know what highlighting group is, but I found airline#highlighter#exec in #1495 and will try hacking a little.

@chrisbra
Copy link
Member

chrisbra commented Mar 7, 2018

the highlighting group is used by the ale extension. airline_warning for the warning section and airline_error for the error part.

@unphased
Copy link

unphased commented Mar 7, 2018

I am able to manipulate the color of the warning section by doing this:

:call airline#highlighter#exec('airline_warning', airline#themes#get_highlight('Select')) " select is just an arbitrary highlight that i chose to try

but it reverts back instantly. How can I (semi-)permanently update the color of one of these sections? Alternatively, how can I add a wholly new section at the end which I want to make visible dynamically? The latter would probably be easier!

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

Successfully merging this pull request may close these issues.

None yet

4 participants