apache / apache/netbeans

LSP API Diagnostic should support an unique ID

Open
#6,971 0 comments 0 reactions 0 assignees View on GitHub
kind:feature
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Description

An `ErrorProvider` must create Diagnostic objects through its Builder, so it cannot control (maintain) the identity easily. But it needs to somehow allow to pair previous and current objects, so that LSP core knows what diagnostics are just published again, and which Diagnostic are not "duplicates".

For Java errors and hints, a line-column info is embeded into `Diagnostic.`code property, which is not good, as the `code` is displayed in the UI - and for example line:column information is duplicated.

The SPI implementor should be able to provide an ID which will be used for matching, separately from the diagnostic code.

### Use case/motivation

_No response_

### Related issues

_No response_

### Are you willing to submit a pull request?

Yes

Contributor guide

Open the contributing guide

Research direction

Start by tracing the ErrorProvider Diagnostic Builder and the LSP core matching behavior described in the issue. Review how Java errors and hints currently place line-column data in Diagnostic.code. Done means an SPI implementor can provide a separate diagnostic ID so previously published diagnostics can be matched without changing the displayed code.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.