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 :enabled property to syntax checkers #1089

Closed
swsnr opened this issue Sep 14, 2016 · 4 comments
Closed

Add :enabled property to syntax checkers #1089

swsnr opened this issue Sep 14, 2016 · 4 comments
Assignees

Comments

@swsnr
Copy link
Contributor

swsnr commented Sep 14, 2016

Add a new :enabled FUNCTION property to syntax checkers which behaves like :predicate except that it's only called the first time a syntax checker is to be used in a buffer. If the function returns a non-nil value the checker is put in a whitelist (i.e. a buffer-local variable) to prevent further invocations of :enabled, and if it returns nil it's put into flycheck-disabled-checkers to prevent any further use of it.

This function would allow for more expensive checks whether a syntax checker is available.

Follow up of a Gitter discussion and #1085.

@swsnr
Copy link
Contributor Author

swsnr commented Sep 14, 2016

@Simplify I've taken the liberty to assign this issue to you but please feel free to ping me if you don't get to implement it. I can add it as well tomorrow evening—though, if you'd take it, I'd spend the evening on #1072 😎

@Simplify
Copy link
Member

yes, I'll take this one, great opportunity to dig dipper into flycheck.

@Simplify
Copy link
Member

flycheck-may-use-checker (checker) is executed every time or only once for every buffer? If only once we can skip maintaining white-listed buffer-list for every checker.

@swsnr
Copy link
Contributor Author

swsnr commented Sep 15, 2016

@Simplify It runs every time.

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

2 participants