Skip to content

Diagnostic message list and marker are not updated after didChange #68971

@sergiuilie

Description

@sergiuilie

There is an issue at display time with Diagnostic message, I will elaborate on that.

Problem:

If a publishDiagnostic message is sent with the same properties, exactly the same, because we change something in the document but not fixing the errors, then nothing is supposed to change, that`s right and it is working out of the box, normal behaviour until the error message is new, contains the same properties and should be displayed on the same position. The issue here is that the position is shifting with the old wrong token and not with the new one as we can see in the following gif:

issue

My diagnostic message is always the same because of the same wrong token position.

5

I think that the problem is coming from extHostDiagnostics.ts class which can be accesed during debug by calling setDiagnostics(uri, diagnostics) from client.js, the boolean hasChanged is exiting the condition on line 118, which seems logic, but not in this case.

7

Solution:

I was thinking what can be one of the simplest solution, bare in mind that I am not a typescript person, so a refresh of the Marker seems acceptable; the second but more complex solution from many points of view is to add a new property to Diagnostic, like a message id.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buglanguages-diagnosticsSource problems reportingverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions