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

Option to skip linting/formatting if rootMarkers can't be resolved? #213

Closed
fsouza opened this issue Apr 18, 2022 · 5 comments · Fixed by #214
Closed

Option to skip linting/formatting if rootMarkers can't be resolved? #213

fsouza opened this issue Apr 18, 2022 · 5 comments · Fixed by #214

Comments

@fsouza
Copy link
Contributor

fsouza commented Apr 18, 2022

Hi there!

Would you take a PR adding an option or something like that to allow linting/formatting/anything else if rootMarkers can't be resolved?

For example:

  • on textDocument/formatting, tries to find a root dir for the command using only the root markers, and if that can't be found, exit early and return the contents unchanged
  • on textDocument/didChange, tries to find a root dir for the command using only the root markers, and i f one can't be found, abort early and publish an empty array of diagnostics for the provided URI
  • do something similar for all other methods (I'd make sure the solution is generic enough without replicating the check everywhere)

What do you think? Is that feasible/acceptable? Thank you!

@mattn
Copy link
Owner

mattn commented Apr 18, 2022

What you want is that efm-langserver do NOT operating linting/formatting/anything if rootMarkers can't be found. Right?

@fsouza
Copy link
Contributor Author

fsouza commented Apr 18, 2022

What you want is that efm-langserver do NOT operating linting/formatting/anything if rootMarkers can't be found. Right?

Exactly. Since that would be a behavior change, I think we should do it behind a new knob. Would that be acceptable?

@mattn
Copy link
Owner

mattn commented Apr 19, 2022

I don't think it's breaking behavior. I think.

@mattn
Copy link
Owner

mattn commented Apr 19, 2022

Please do

@fsouza
Copy link
Contributor Author

fsouza commented Apr 19, 2022

Oh, looks like for linting it's already in-place: fdd0aab

I can reuse the strategy and the config flag for textDocument/formatting. Will do that and open a PR

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 a pull request may close this issue.

2 participants