Skip to content

Go to next problem sorted by diagnostic start position #135249

@pohzipohzi

Description

@pohzipohzi

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).

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code Insiderslanguages-diagnosticsSource problems reportingon-release-notesIssue/pull request mentioned in release notesverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions