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 filtering diagnostics #655

Merged
merged 6 commits into from
Jun 17, 2022
Merged

Conversation

pfoerster
Copy link
Member

This PR provides support for filtering the diagnostics by providing two new settings texlab.diagnostics.allowedPatterns and texlab.diagnostics.ignoredPatterns. Both take a list of regular expressions that are matched against the message.
Example:

{ 
   "texlab.diagnostics.ignoredPatterns": [ 
      "Overfull \\[hv]box" 
   ] 
}

@codecov
Copy link

codecov bot commented Jun 16, 2022

Codecov Report

Merging #655 (568edf9) into master (b6bd9ba) will decrease coverage by 0.55%.
The diff coverage is 57.26%.

@@            Coverage Diff             @@
##           master     #655      +/-   ##
==========================================
- Coverage   78.72%   78.16%   -0.56%     
==========================================
  Files         119      119              
  Lines       11360    11504     +144     
==========================================
+ Hits         8943     8992      +49     
- Misses       2417     2512      +95     
Impacted Files Coverage Δ
src/diagnostics/chktex.rs 0.00% <0.00%> (ø)
src/lib.rs 100.00% <ø> (ø)
src/diagnostics/latex.rs 68.14% <46.34%> (-3.16%) ⬇️
src/diagnostics/bibtex.rs 53.78% <49.27%> (-20.62%) ⬇️
src/server.rs 42.99% <53.01%> (-7.83%) ⬇️
src/options.rs 31.25% <66.66%> (+1.01%) ⬆️
src/diagnostics.rs 69.79% <70.00%> (-12.03%) ⬇️
src/debouncer.rs 80.00% <80.00%> (ø)
src/diagnostics/build.rs 97.95% <100.00%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b6bd9ba...568edf9. Read the comment docs.

@clason
Copy link
Contributor

clason commented Jun 16, 2022

Looks good! What happens if both ignorePatterns and allowPatterns is specified?

(I can't test at the moment since for some reason texlab no longer respects the options I set in my Neovim config. I'll have to bisect that -- has anything relevant changed in recent time?)

@pfoerster
Copy link
Member Author

What happens if both ignorePatterns and allowPatterns is specified?

The allowed patterns are applied first, the results are then filtered by the ignored patterns.

I can't test at the moment since for some reason texlab no longer respects the options I set in my Neovim config.

I think, this may be caused by ae4a126. texlab no longer spams those configuration requests. Instead, it should query the configuration once at startup and then listen for didChangeConfiguration and query as needed.

@clason
Copy link
Contributor

clason commented Jun 16, 2022

The allowed patterns are applied first, the results are then filtered by the ignored patterns.

Might be good to document that?

I think, this may be caused by ae4a126. texlab no longer spams those configuration requests. Instead, it should query the configuration once at startup and then listen for didChangeConfiguration and query as needed.

Hmmm, I don't think so, as I can reproduce that on 3.3.0. Must be an issue on my side. (Funnily, it only seems to affect texlab, though.)

@pfoerster
Copy link
Member Author

Might be good to document that?

Yeah, definitely 👍

Must be an issue on my side

This might also be related to bd85205 (especially if the client does not send all config properties).

@pfoerster pfoerster merged commit f861d53 into master Jun 17, 2022
@pfoerster pfoerster deleted the diagnostic-filtering branch January 29, 2023 16:05
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.

2 participants