ballerina-platform / ballerina-lang

The Ballerina Programming Language
https://ballerina.io/
Apache License 2.0
3.54k stars 733 forks source link

[Task]: Deprecate the `diagnosticProperty` API from the `DiagBasedPositionDetails` class #42644

Open nipunayf opened 2 weeks ago

nipunayf commented 2 weeks ago

Description

As shown below, there are two APIs to obtain a diagnostic property from a diagnostic in a diagnostic-based code action. However, the first API has a risk of throwing an out-of-bound exception. Hence, the codebase should be refactored to remove the first API and only use the latter one.

https://github.com/ballerina-platform/ballerina-lang/blob/f67afde58bf14d98559b9f3209a9577cb4b23962/language-server/modules/langserver-commons/src/main/java/org/ballerinalang/langserver/commons/codeaction/spi/DiagBasedPositionDetails.java#L58-L72

Describe your task(s)

No response

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response