-
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 similar text suggestion Code Action(s) for UndefinedObject and UndefinedNamespace #670
Added similar text suggestion Code Action(s) for UndefinedObject and UndefinedNamespace #670
Conversation
1eeb8c7
to
7cb1f00
Compare
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteCodeActions.java
Outdated
Show resolved
Hide resolved
d30e985
to
612fead
Compare
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteCodeActions.java
Outdated
Show resolved
Hide resolved
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteCodeActions.java
Outdated
Show resolved
Hide resolved
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteCodeActions.java
Outdated
Show resolved
Hide resolved
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteCodeActions.java
Outdated
Show resolved
Hide resolved
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteCodeActions.java
Outdated
Show resolved
Hide resolved
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteCodeActions.java
Outdated
Show resolved
Hide resolved
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteCodeActions.java
Outdated
Show resolved
Hide resolved
92e8ad3
to
9519ca1
Compare
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.
Seems to be going in the right direction. Just some things to fix. I would really look at what the difference is between an expression, expressionpart and expressionparts as well as what their structure is like. That should help avoid any casting issues.
[Error - 10:53:06 a.m.] Request textDocument/codeAction failed.
Message: Internal error.
Code: -32603
java.util.concurrent.CompletionException: java.lang.ClassCastException: class com.redhat.qute.parser.expression.Parts cannot be cast to class com.redhat.qute.parser.expression.Part (com.redhat.qute.parser.expression.Parts and com.redhat.qute.parser.expression.Part are in unnamed module of loader 'app')
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.postFire(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Caused by: java.lang.ClassCastException: class com.redhat.qute.parser.expression.Parts cannot be cast to class com.redhat.qute.parser.expression.Part (com.redhat.qute.parser.expression.Parts and com.redhat.qute.parser.expression.Part are in unnamed module of loader 'app')
at com.redhat.qute.services.QuteCodeActions.doCodeActionsForSimilarValues(QuteCodeActions.java:368)
at com.redhat.qute.services.QuteCodeActions.doCodeActions(QuteCodeActions.java:128)
at com.redhat.qute.services.QuteLanguageService.doCodeActions(QuteLanguageService.java:99)
at com.redhat.qute.ls.template.TemplateFileTextDocumentService.lambda$codeAction$9(TemplateFileTextDocumentService.java:158)
at com.redhat.qute.ls.commons.ModelTextDocuments.lambda$computeModelAsyncCompose$2(ModelTextDocuments.java:145)
... 10 more
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/utils/LevenshteinDistance.java
Show resolved
Hide resolved
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteCodeActions.java
Outdated
Show resolved
Hide resolved
2dc0984
to
bf8b5f4
Compare
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.
Still a bit of work to support spelling errors for an object's properties/methods.
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteCodeActions.java
Outdated
Show resolved
Hide resolved
bf8b5f4
to
aea1d0f
Compare
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteDiagnostics.java
Outdated
Show resolved
Hide resolved
0f13a51
to
ee0ed06
Compare
264f53e
to
58df6a2
Compare
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteCodeActions.java
Outdated
Show resolved
Hide resolved
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteCodeActions.java
Outdated
Show resolved
Hide resolved
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteCodeActions.java
Outdated
Show resolved
Hide resolved
You need to update QuteDiagnosticsInExpressionWithForSectionTest.undefinedObjectInElseBlock:60 expected: <3> but was: <4> because your similar value report a code action with "items" as similar value for "item". |
@AlexXuChen as it required so many changes, I decided to create a draft PR with my suggestions, see my draft PR based on your PR at #682 All tests should work. I have implemented namespace similar value without testing, please write tests like I suggested in #670 (comment) |
6e9e99d
to
8b5453b
Compare
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/parser/expression/Parts.java
Outdated
Show resolved
Hide resolved
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/parser/expression/Parts.java
Outdated
Show resolved
Hide resolved
63f121b
to
b0fb64d
Compare
966d557
to
23ef690
Compare
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/project/QuteProjectRegistry.java
Show resolved
Hide resolved
444cc78
to
03fd06f
Compare
…UndefinedNamespace Signed-off-by: Alexander Chen <alchen@redhat.com>
03fd06f
to
94fa2de
Compare
Thanks a lot @AlexXuChen ! |
Added Qute
Did you mean ...?
CodeAction(s) for similar text suggestions forUndefinedNamespace
,UndefinedObject
.Fixes #602
Signed-off-by: Alexander Chen alchen@redhat.com