Skip to content

Commit

Permalink
Set the deprecated tag to compiler.warn.has.been.deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
nya3jp committed Dec 29, 2024
1 parent f7db687 commit 5eab174
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/javacs/lsp/DiagnosticTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

public class DiagnosticTag {
public static final int Unnecessary = 1;
public static final int Deprecated = 2;
}
3 changes: 3 additions & 0 deletions src/main/java/org/javacs/markup/ErrorProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ private org.javacs.lsp.Diagnostic lspDiagnostic(javax.tools.Diagnostic<? extends
result.message = message;
result.range =
new Range(new Position(startLine - 1, startColumn - 1), new Position(endLine - 1, endColumn - 1));
if (code.equals("compiler.warn.has.been.deprecated")) {
result.tags = List.of(DiagnosticTag.Deprecated);
}
return result;
}

Expand Down

0 comments on commit 5eab174

Please sign in to comment.