-
Notifications
You must be signed in to change notification settings - Fork 51
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
Path params quickfix #278
Path params quickfix #278
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The quick fix works well on my end.
.../src/main/java/org/eclipse/lsp4jakarta/jdt/core/websocket/WebSocketDiagnosticsCollector.java
Outdated
Show resolved
Hide resolved
...karta.jdt.test/src/main/java/org/eclipse/lsp4jakarta/jdt/websocket/JakartaWebSocketTest.java
Outdated
Show resolved
Hide resolved
....jdt.core/src/main/java/org/eclipse/lsp4jakarta/jdt/core/websocket/AddPathParamQuickFix.java
Outdated
Show resolved
Hide resolved
@@ -31,20 +33,21 @@ | |||
import org.eclipse.lsp4jakarta.jdt.codeAction.proposal.ModifyAnnotationProposal; | |||
|
|||
/** | |||
* Quickfix for adding missing attributes to annotations | |||
* Quickfix for adding missing attributes to new or existing annotations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we clarify a bit further?
"Quickfix for adding new annotations or adding attributes to existing annotations"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do that
protected String getLabel(String annotation, String... attributes) { | ||
String type = ""; | ||
|
||
String name = "Add " + attributes[0] + " to " + annotation; | ||
name = name.concat(type); | ||
return name; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally I think we should handle the two label cases in this class (adding an annotation & adding an attribution to an annotation).
What do you think about this label being "Insert @Annotation
" and then we create a new class "InsertAnnotationAttributesQuickFix" which extends "InsertAnnotationQuickFix" and overrides the label to the above? Then we don't have to include the label specific logic in "AddPathParamsQuickFix" and it can easily be reused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a good idea! will implement that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, thanks @dalidia
Resolves #276