Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nipunayf opened this issue Apr 26, 2024 · 0 comments
Labels
Area/CodeAction Language Server Code Actions Team/LanguageServer Language Server Implementation related issues. #Compiler Type/Task

Comments

@nipunayf
Copy link
Contributor

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.

/**
* Returns optional value of the diagnostic property.
*
* @param propertyIndex property index
* @return Value of the property at given index
*/
<T> Optional<T> diagnosticProperty(int propertyIndex);
/**
* Returns optional value of the diagnostic property.
*
* @param function Function to be invoked on the diagnostic properties.
* @return Value of the property returned by the specified function.
*/
<T> Optional<T> diagnosticProperty(Function<List<DiagnosticProperty<?>>, Optional<T>> function);

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

@nipunayf nipunayf added Type/Task Team/LanguageServer Language Server Implementation related issues. #Compiler Area/CodeAction Language Server Code Actions labels Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/CodeAction Language Server Code Actions Team/LanguageServer Language Server Implementation related issues. #Compiler Type/Task
Projects
None yet
Development

No branches or pull requests

1 participant