Skip to content

nextDiagnostic only selects part of the diagnostic when there is overlapping #1671

@bhsd-harry

Description

@bhsd-harry

Describe the issue

Some linters may generate overlapping diagnostics. When there are overlapping diagnostics, nextDiagnostic only selects part of a diagnostic, which can be confusing. Like in the example below, when placing the cursor at the beginning of the document, pressing F8 for the first time selects only the first line of a warning.
I think it is expected to select the entire range of the diagnostic.

Browser and platform

No response

Reproduction link

https://codemirror.net/try/#c=aW1wb3J0IHtFZGl0b3JWaWV3LCBrZXltYXB9IGZyb20gJ0Bjb2RlbWlycm9yL3ZpZXcnCmltcG9ydCB7bGludGVyLCBsaW50S2V5bWFwfSBmcm9tICdAY29kZW1pcnJvci9saW50JwoKbmV3IEVkaXRvclZpZXcoewogIGRvYzogInBhcnQgb2Ygd2FybmluZ1xuZXJyb3JcbnBhcnQgb2Ygd2FybmluZyIsCiAgZXh0ZW5zaW9uczogWwogICAgbGludGVyKCgpID0+IFsKICAgICAge2Zyb206IDAsIHRvOiAzNywgc2V2ZXJpdHk6ICd3YXJuaW5nJywgbWVzc2FnZTogJ0xpbmVzIDEtMyd9LAogICAgICB7ZnJvbTogMTYsIHRvOiAyMSwgc2V2ZXJpdHk6ICdlcnJvcicsIG1lc3NhZ2U6ICdMaW5lIDInfSwKICAgIF0pLAogICAga2V5bWFwLm9mKGxpbnRLZXltYXApCiAgXSwKICBwYXJlbnQ6IGRvY3VtZW50LmJvZHkKfSkK

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions