Skip to content

Commit 5ef404c

Browse files
committed
Release 0.0.37
1 parent 4682ba1 commit 5ef404c

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "liquid-java",
33
"displayName": "LiquidJava",
44
"description": "LiquidJava - Extending Java with Liquid Types",
5-
"version": "0.0.36",
5+
"version": "0.0.37",
66
"publisher": "AlcidesFonseca",
77
"repository": {
88
"type": "git",
-5.66 KB
Binary file not shown.

server/src/main/java/LJDiagnostics.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,27 @@ public class LJDiagnostics {
2525
* @return diagnostics
2626
*/
2727
public static List<PublishDiagnosticsParams> generateDiagnostics(String uri) {
28+
List<PublishDiagnosticsParams> result = new ArrayList<>();
2829
try {
2930
String path = convertUTFtoCharacters(extractBasePath(uri));
3031
CommandLineLauncher.launch(path);
3132
Diagnostics diagnostics = Diagnostics.getInstance();
33+
3234
if (diagnostics.foundError()) {
3335
System.out.println("Failed verification");
3436
List<LJDiagnostic> errors = new ArrayList<>(diagnostics.getErrors());
35-
return getDiagnostics(uri, errors, DiagnosticSeverity.Error);
37+
result.addAll(getDiagnostics(uri, errors, DiagnosticSeverity.Error));
3638
} else {
3739
System.out.println("Passed verification");
38-
if (diagnostics.foundWarning()) {
39-
System.out.println("Found warnings");
40-
List<LJDiagnostic> warnings = new ArrayList<>(diagnostics.getWarnings());
41-
return getDiagnostics(uri, warnings, DiagnosticSeverity.Warning);
42-
} else {
43-
System.out.println("No errors or warnings found");
44-
return List.of(getEmptyDiagnostics(uri));
45-
}
4640
}
41+
if (diagnostics.foundWarning()) {
42+
List<LJDiagnostic> warnings = new ArrayList<>(diagnostics.getWarnings());
43+
result.addAll(getDiagnostics(uri, warnings, DiagnosticSeverity.Warning));
44+
}
45+
return result.isEmpty() ? List.of(getEmptyDiagnostics(uri)) : result;
4746
} catch (Exception e) {
4847
System.err.println("Exception:" + e.getMessage());
49-
return List.of(getEmptyDiagnostics(uri));
48+
return result;
5049
}
5150
}
5251

0 commit comments

Comments
 (0)