-
Notifications
You must be signed in to change notification settings - Fork 16
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 refactoring for changing with section to let #563
base: master
Are you sure you want to change the base?
Conversation
00f52fa
to
9fee111
Compare
As discussed, I think a good starting point would be to highlight the entire range as opposed to just the start element. It's likely that we won't need to set the deprecated tag. |
9b2f96c
to
9a87820
Compare
7e81a8e
to
cd32991
Compare
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteDiagnostics.java
Outdated
Show resolved
Hide resolved
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.
Overall, works well. Just a few minor fixes and one special case.
....ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/diagnostics/QuteErrorCode.java
Outdated
Show resolved
Hide resolved
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteDiagnostics.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
45867a2
to
037a9fa
Compare
In the demo, the code action doesn't generate properly the #let fix (yo can see warning on name and price. The code action should generate:
After that, please write tests with diagnostic and code action. |
fee85eb
to
e15e8fa
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
e15e8fa
to
aa1604d
Compare
...ava/com/redhat/qute/services/diagnostics/QuteDiagnosticsInExpressionWithWithSectionTest.java
Show resolved
Hide resolved
b6ac712
to
d2d635a
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
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
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/QuteDiagnostics.java
Outdated
Show resolved
Hide resolved
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteDiagnostics.java
Outdated
Show resolved
Hide resolved
...redhat.qute.ls/src/main/java/com/redhat/qute/services/diagnostics/DiagnosticDataFactory.java
Outdated
Show resolved
Hide resolved
If we use deprecated tags in the future, create public static Diagnostic createDiagnosticWithTags(Range range, DiagnosticSeverity severity,
IQuteErrorCode errorCode, List<DiagnosticTag> tags, Object... arguments) {
String message = errorCode.getMessage(arguments);
Diagnostic diagnostic = new Diagnostic(range, message, severity, QUTE_SOURCE,
errorCode != null ? errorCode.getCode() : null);
diagnostic.setTags(tags);
return diagnostic;
} in |
8029c9b
to
cc21c50
Compare
cc21c50
to
416a9f6
Compare
@@ -106,6 +106,16 @@ public static CodeAction replace(String title, Range range, String replaceText, | |||
return replace(title, Collections.singletonList(replace), document, diagnostic); | |||
} | |||
|
|||
@SuppressWarnings("null") | |||
public static CodeAction replace(String title, List<Range> ranges, String replaceText, TextDocumentItem document, |
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.
Add a javadoc
23d4294
to
7806f85
Compare
Signed-off-by: Alexander Chen <[email protected]>
7806f85
to
11955cf
Compare
|
the code action should appear as a refactoring item |
Added diagnostic for deprecated
#with
section and CodeAction to use#let
.Fixes #489
Signed-off-by: Alexander Chen [email protected]