ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.36k stars 2.8k forks source link

[READY] Handle multiple identical diagnostics in YcmShowDetailedDiagnostic popup #4219

Closed bstaletic closed 5 months ago

bstaletic commented 5 months ago

PR Prelude

Thank you for working on YCM! :)

Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your PR:

Why this change is necessary and useful

If a line for which detailed diagnostics are requested contains more than a single diagnostic with the same message, YCM will try options.pop( 'col' ) more than once.

We do not need to really iterate through the diagnostics once we have found the first one that is a match. If there's only one diag with the matching message, looping beyond that diagnostic is just a waste of time. If there's multiple diagnostics with the same message, it does not matter which one we display in the popup.

Hence, the added break at the end of the loop.


This change is Reviewable

codecov[bot] commented 5 months ago

Codecov Report

Merging #4219 (cea2458) into master (c55e732) will increase coverage by 0.02%. The diff coverage is 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4219 +/- ## ========================================== + Coverage 89.71% 89.74% +0.02% ========================================== Files 34 34 Lines 4424 4425 +1 ========================================== + Hits 3969 3971 +2 + Misses 455 454 -1 ```
mergify[bot] commented 5 months ago

Thanks for sending a PR!