-
-
Notifications
You must be signed in to change notification settings - Fork 23
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 options.ignoreUnconfigured
#64
Conversation
This comment has been minimized.
This comment has been minimized.
When turning this option on, files will only be used if they have an associated detected configuration file. Other files will be ignored. Given that configuration actually happens much later than finding files, how it works is more similar to how a fatal error or so prevents a file from being processed, instead of actual files being ignored. Related-to: unifiedjs/unified-language-server#30.
ea98e73
to
1bb8496
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just found a couple of nits, but nothing blocking.
Thanks for adding this option! <3
done | ||
) | ||
|
||
function done(error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: The following might give a better id of what’s available in the callback:
function done(error) { | |
function done(error, code, context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They’re unused. The code style strips those away. None of the others do this either. So definitely 👎 for doing it in this case in this PR, but open to discussing changing it (here, everywhere?), although I’m personally 👎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was just a suggestion. I have no strong feelings on this.
// If there was no explicit corresponding config file found | ||
if (!configuration.filePath && context.settings.ignoreUnconfigured) { | ||
debug('Ignoring file w/o corresponding config file') | ||
file.data.unifiedEngineIgnored = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh cool! So this property is available now after processing too. We don’t need it in unified-language-server
now, but it might come in handy some day. Should it be documented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is more a new, another way, to ignore files.
Each step that handles a file now does nothing when this field is set.
I am not particularly fond of documenting it, and neither are the two other existing namespaced fields, because they’re not really meant to be “used” by folks, although documenting them might at least help serve folks that google them because they’re on their files for some reason.
Co-authored-by: Remco Haszing <remcohaszing@gmail.com>
Initial checklist
Description of changes
When turning this option on, files will only be used if they have an
associated detected configuration file.
Other files will be ignored.
Given that configuration actually happens much later than finding files,
how it works is more similar to how a fatal error or so prevents a file
from being processed, instead of actual files being ignored.
/cc @remcohaszing