-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rome Li <[email protected]>
- Loading branch information
1 parent
5ffb538
commit 4e7b115
Showing
1 changed file
with
29 additions
and
29 deletions.
There are no files selected for viewing
58 changes: 29 additions & 29 deletions
58
org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/DiagnosticTag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,48 @@ | ||
/****************************************************************************** | ||
* Copyright (c) 2019 Mcirosoft. | ||
* | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0, | ||
* or the Eclipse Distribution License v. 1.0 which is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.php. | ||
* | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause | ||
******************************************************************************/ | ||
|
||
package org.eclipse.lsp4j; | ||
|
||
public enum DiagnosticTag { | ||
/** | ||
* Unused or unnecessary code. | ||
* | ||
|
||
/** | ||
* Unused or unnecessary code. | ||
* | ||
* Clients are allowed to render diagnostics with this tag faded out instead of having | ||
* an error squiggle. | ||
*/ | ||
* an error squiggle. | ||
*/ | ||
Unnecessary(1), | ||
/** | ||
* Deprecated or obsolete code. | ||
* | ||
|
||
/** | ||
* Deprecated or obsolete code. | ||
* | ||
* Clients are allowed to rendered diagnostics with this tag strike through. | ||
*/ | ||
*/ | ||
Deprecated(2); | ||
|
||
private final int value; | ||
DiagnosticTag(int value) { | ||
this.value = value; | ||
} | ||
public int getValue() { | ||
return value; | ||
} | ||
public static DiagnosticTag forValue(int value) { | ||
DiagnosticTag[] allValues = DiagnosticTag.values(); | ||
if (value < 1 || value > allValues.length) | ||
throw new IllegalArgumentException("Illegal enum value: " + value); | ||
return allValues[value - 1]; | ||
} | ||
private final int value; | ||
|
||
DiagnosticTag(int value) { | ||
this.value = value; | ||
} | ||
|
||
public int getValue() { | ||
return value; | ||
} | ||
|
||
public static DiagnosticTag forValue(int value) { | ||
DiagnosticTag[] allValues = DiagnosticTag.values(); | ||
if (value < 1 || value > allValues.length) | ||
throw new IllegalArgumentException("Illegal enum value: " + value); | ||
return allValues[value - 1]; | ||
} | ||
} |