Skip to content

Commit 0e408bd

Browse files
committed
Set the deprecated tag to compiler.warn.has.been.deprecated
1 parent 8fbe786 commit 0e408bd

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/main/java/org/javacs/lsp/DiagnosticTag.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
public class DiagnosticTag {
44
public static final int Unnecessary = 1;
5+
public static final int Deprecated = 2;
56
}

src/main/java/org/javacs/markup/ErrorProvider.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ private org.javacs.lsp.Diagnostic lspDiagnostic(javax.tools.Diagnostic<? extends
8686
result.message = message;
8787
result.range =
8888
new Range(new Position(startLine - 1, startColumn - 1), new Position(endLine - 1, endColumn - 1));
89+
if (code.equals("compiler.warn.has.been.deprecated")) {
90+
result.tags = List.of(DiagnosticTag.Deprecated);
91+
}
8992
return result;
9093
}
9194

0 commit comments

Comments
 (0)