Skip to content

Go to next problem sorted by diagnostic start position #135249

Closed

Description

Requested Feature

From my current cursor position, I will like to jump to the problem with the closest diagnostic start position (ie the next/previous underlined word, no matter the color).

Issue Description

Consider the following python snippet:

import math
impor math # warning, error
import mat # warning
print('hello' # error

At time of writing, pylance (from the python extension) reports 4 alternating error/warning problems with the above snippet. When cycling through the problems from line 1 (via editor.action.marker.next), the cursor jumps to lines in the order 2(error)->4(error)->2(warning)->3(warning).

While this may be the expected behaviour (as indicated by the command title Go to Next Problem (Error, Warning, Info)), I found this non-line-sequential behaviour to be fairly confusing as I expected my cursor to simply jump to the next underlined word.

Additionally, diagnostic severity levels are reevaluated every time we exit a chain of continuous jumps (eg. via ESC). For example, if we go from 2(error)->4(error)->2(warning)->ESC, rerunning the command causes the cursor to jump to 2(error) again.

It will be nice if we can implement a similar command which jumps to the next problem ordered by diagnostic start positions. In the above example, the expected behaviour for a cursor cycling through problems from line 1 would be 2(warning)->2(error)->3(warning)->4(error).

Activity

  1. added
    feature-request
    languages-diagnostics
    on Oct 19, 2021
  2. vscode-triage-bot commented on Oct 20, 2021

    @vscode-triage-bot

    This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

    Happy Coding!

  3. pohzipohzi commented on Oct 25, 2021

    @pohzipohzi
    ContributorAuthor

    Johannes Rieken (@jrieken) in hindsight this seems more like a bug than a feature request. I made a PR that "fixes" this behaviour - what do you think?

  4. added
    unreleased
    insiders-released
    and removed
    unreleased
    on Nov 1, 2021
  5. added
    verification-needed
    on Nov 29, 2021
  6. jrieken commented on Nov 29, 2021

    @jrieken
    Contributor

    To verify make sure there this setting and that it works: problems.compareOrder

  7. added
    verified
    on Dec 1, 2021
  8. rchiodo commented on Dec 1, 2021

    @rchiodo
    Contributor

    /verified

  9. jrieken commented on Dec 2, 2021

    @jrieken
    Contributor

    fyi - renamed this setting to problems.sortOrder to align with other settings

  10. added
    on-release-notes
    on Dec 2, 2021
  11. locked and limited conversation to collaborators on Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestinsiders-releasedlanguages-diagnosticson-release-notesverification-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions