Skip to content

Commit d66fd19

Browse files
committed
Add symbol tags as proposed for LSP specification
See microsoft/language-server-protocol#2003
1 parent fd40a78 commit d66fd19

File tree

3 files changed

+161
-3
lines changed

3 files changed

+161
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
### v1.0.0 (TBD)
44

5+
* Implemented [LSP proposal](https://github.com/microsoft/language-server-protocol/pull/2003) for `SymbolTag` [#856](https://github.com/eclipse-lsp4j/lsp4j/pull/856)
6+
57
Fixed issues: <https://github.com/eclipse-lsp4j/lsp4j/milestone/37?closed=1>
68

79
* Removed `@Deprecated` annotations on members deprecated in the LSP/DAP protocol [#895](https://github.com/eclipse-lsp4j/lsp4j/issues/895)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The Maven Repositories, p2 Update Sites, and the Snapshots contain _signed jars_
3535

3636
### Supported LSP Versions
3737

38-
* LSP4J 1.0.&ast; _(Next release)_ &rarr; LSP 3.17.0
38+
* LSP4J 1.0.&ast; _(Next release)_ &rarr; LSP 3.17.0 (plus [SymbolTag proposal](https://github.com/microsoft/language-server-protocol/pull/2003))
3939
* LSP4J 0.24.&ast; &rarr; LSP 3.17.0
4040
* LSP4J 0.23.&ast; &rarr; LSP 3.17.0
4141
* LSP4J 0.22.&ast; &rarr; LSP 3.17.0

org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/SymbolTag.java

Lines changed: 158 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,173 @@
1212

1313
package org.eclipse.lsp4j;
1414

15+
import org.eclipse.lsp4j.jsonrpc.ProtocolDraft;
16+
17+
1518
/**
1619
* Symbol tags are extra annotations that tweak the rendering of a symbol.
17-
* <p>
1820
* Since 3.16
1921
*/
2022
public enum SymbolTag {
2123

2224
/**
2325
* Render a symbol as obsolete, usually using a strike-out.
26+
* Since 3.16
27+
*/
28+
Deprecated(1),
29+
30+
/**
31+
* <p>Render a symbol with visibility / access modifier "private".</p>
32+
*
33+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
34+
*/
35+
@ProtocolDraft
36+
Private(2),
37+
38+
/**
39+
* <p>Render a symbol with visibility "package private", e.g. in Java.</p>
40+
*
41+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
42+
*/
43+
@ProtocolDraft
44+
Package(3),
45+
46+
/**
47+
* <p>Render a symbol with visibility / access modifier "protected".
48+
* The modifier could be combined e.g. with "internal" or "private" in languages like C#.</p>
49+
*
50+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
51+
*/
52+
@ProtocolDraft
53+
Protected(4),
54+
55+
/**
56+
* <p>Render a symbol with visibility / access modifier "public".</p>
57+
*
58+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
59+
*/
60+
@ProtocolDraft
61+
Public(5),
62+
63+
/**
64+
* <p>Render a symbol with visibility / access modifier "internal", e.g. in C# or Kotlin.</p>
65+
*
66+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
67+
*/
68+
@ProtocolDraft
69+
Internal(6),
70+
71+
/**
72+
* <p>Render a symbol with visibility / access modifier "file", e.g. in C#.</p>
73+
*
74+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
75+
*/
76+
@ProtocolDraft
77+
File(7),
78+
79+
/**
80+
* <p>Render a symbol as "static".</p>
81+
*
82+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
83+
*/
84+
@ProtocolDraft
85+
Static(8),
86+
87+
/**
88+
* <p>Render a symbol as "abstract".</p>
89+
*
90+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
91+
*/
92+
@ProtocolDraft
93+
Abstract(9),
94+
95+
/**
96+
* <p>Render a symbol as "final".</p>
97+
*
98+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
99+
*/
100+
@ProtocolDraft
101+
Final(10),
102+
103+
/**
104+
* <p>Render a symbol as "sealed", e.g. classes and interfaces in Kotlin.</p>
105+
*
106+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
107+
*/
108+
@ProtocolDraft
109+
Sealed(11),
110+
111+
/**
112+
* <p>Render a symbol as "transient", e.g. in Java.</p>
113+
*
114+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
115+
*/
116+
@ProtocolDraft
117+
Transient(12),
118+
119+
/**
120+
* <p>Render a symbol as "volatile", e.g. in Java.</p>
121+
*
122+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
123+
*/
124+
@ProtocolDraft
125+
Volatile(13),
126+
127+
/**
128+
* <p>Render a symbol as "synchronized", e.g. in Java.</p>
129+
*
130+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
131+
*/
132+
@ProtocolDraft
133+
Synchronized(14),
134+
135+
/**
136+
* <p>Render a symbol as "virtual", e.g. in C++.</p>
137+
*
138+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
139+
*/
140+
@ProtocolDraft
141+
Virtual(15),
142+
143+
/**
144+
* <p>Render a symbol as "nullable", e.g. types with '?' in Kotlin.</p>
145+
*
146+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
147+
*/
148+
@ProtocolDraft
149+
Nullable(16),
150+
151+
/**
152+
* <p>Render a symbol as "never null", e.g. types without '?' in Kotlin.</p>
153+
*
154+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
155+
*/
156+
@ProtocolDraft
157+
NonNull(17),
158+
159+
/**
160+
* <p>Render a symbol as declaration.</p>
161+
*
162+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
163+
*/
164+
@ProtocolDraft
165+
Declaration(18),
166+
167+
/**
168+
* <p>Render a symbol as definition (in contrast to declaration), e.g. in header files in C++.</p>
169+
*
170+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
171+
*/
172+
@ProtocolDraft
173+
Definition(19),
174+
175+
/**
176+
* <p>Render a symbol as "read-only", i.e. variables / properties that cannot be changed.</p>
177+
*
178+
* <p>This is an LSP <b>proposal</b>. See <a href="https://github.com/microsoft/language-server-protocol/pull/2003">PR</a></p>
24179
*/
25-
Deprecated(1);
180+
@ProtocolDraft
181+
ReadOnly(20);
26182

27183
private final int value;
28184

0 commit comments

Comments
 (0)