-
Notifications
You must be signed in to change notification settings - Fork 15
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
Added Qute CodeAction(s) for similar text suggestions for UnknownProperty
#693
Added Qute CodeAction(s) for similar text suggestions for UnknownProperty
#693
Conversation
private Collection<String> collectAvailableValuesForPropertyPart(PropertyPart node, Template template, | ||
String resolvedType) { | ||
String projectUri = template.getProjectUri(); | ||
return javaCache.resolveJavaType(resolvedType, projectUri).getNow(null).getFields().stream() |
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.
You dont need to use javaCache here. You can use directly baseResolvedType
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.
I suggest that you see property completion at
Line 276 in 03b06df
private CompletionList doCompleteForJavaTypeMembers(ResolvedJavaTypeInfo baseType, int start, int end, |
....ls/src/main/java/com/redhat/qute/services/codeactions/QuteCodeActionForUnknownProperty.java
Outdated
Show resolved
Hide resolved
....ls/src/main/java/com/redhat/qute/services/codeactions/QuteCodeActionForUnknownProperty.java
Show resolved
Hide resolved
64686f4
to
eb2918c
Compare
@@ -70,12 +76,14 @@ public void doCodeActions(CodeActionRequest request, List<CompletableFuture<Void | |||
QuteTemplateGenerateMissingJavaMember resolver = request.getResolver(); | |||
SharedSettings sharedSettings = request.getSharedSettings(); | |||
|
|||
Part propertyPart = (Part) request.getCoveredNode(); | |||
Part part = (Part) node; |
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.
Caste in PropertyPart
....ls/src/main/java/com/redhat/qute/services/codeactions/QuteCodeActionForUnknownProperty.java
Show resolved
Hide resolved
|
||
List<String> javaFieldNames = baseResolvedType.getFields().stream().map(x -> x.getName()) | ||
.collect(Collectors.toList()); | ||
for (String fieldName : javaFieldNames) { |
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.
availableValues.addAll(javaFieldNames)
} | ||
} | ||
|
||
return availableValues; |
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.
It misses methods without parameters and value resolvers. See completion for property
Signed-off-by: Alexander Chen <alchen@redhat.com>
eb2918c
to
58992ec
Compare
@@ -183,4 +195,110 @@ private static void doCodeActionToCreateTemplateExtensionsClass(String missingPr | |||
})); | |||
} | |||
|
|||
private static void doCodeActionToCreateProperty(Part propertyPart, ResolvedJavaTypeInfo baseResolvedType, |
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.
Why have you this static method which break the build in your PR? .
Replaced with #713 |
Added Qute CodeAction(s) for similar text suggestions for
UnknownProperty
.Part of #602
Signed-off-by: Alexander Chen alchen@redhat.com