File tree Expand file tree Collapse file tree 6 files changed +51
-0
lines changed
src/main/java/io/protostuff/jetbrains/plugin/psi Expand file tree Collapse file tree 6 files changed +51
-0
lines changed Original file line number Diff line number Diff line change 1010import com .intellij .navigation .ItemPresentationProviders ;
1111import com .intellij .psi .PsiElement ;
1212import com .intellij .psi .PsiNamedElement ;
13+ import io .protostuff .jetbrains .plugin .Icons ;
14+ import javax .swing .Icon ;
1315import org .antlr .jetbrains .adapter .psi .ScopeNode ;
1416import org .jetbrains .annotations .NotNull ;
1517import org .jetbrains .annotations .Nullable ;
@@ -59,6 +61,12 @@ public ASTNode getConstantValueNode() {
5961 return node .findChildByType (rule (RULE_enumFieldValue ));
6062 }
6163
64+ @ Nullable
65+ @ Override
66+ public Icon getIcon (int flags ) {
67+ return Icons .CONSTANT ;
68+ }
69+
6270 @ Override
6371 public ItemPresentation getPresentation () {
6472 return ItemPresentationProviders .getItemPresentation (this );
Original file line number Diff line number Diff line change 77import com .intellij .psi .stubs .IStubElementType ;
88import com .intellij .psi .tree .IElementType ;
99import com .intellij .util .IncorrectOperationException ;
10+ import io .protostuff .jetbrains .plugin .Icons ;
1011import io .protostuff .jetbrains .plugin .psi .stubs .EnumStub ;
1112import io .protostuff .jetbrains .plugin .psi .stubs .MessageStub ;
1213import java .util .Arrays ;
1314import java .util .List ;
15+ import javax .swing .Icon ;
1416import org .jetbrains .annotations .NotNull ;
17+ import org .jetbrains .annotations .Nullable ;
1518
1619/**
1720 * Enum node.
@@ -40,6 +43,12 @@ public PsiElement setName(@NotNull String name) throws IncorrectOperationExcepti
4043 return GenericNameNode .setName (this , name );
4144 }
4245
46+ @ Nullable
47+ @ Override
48+ public Icon getIcon (int flags ) {
49+ return Icons .ENUM ;
50+ }
51+
4352 @ Override
4453 public ItemPresentation getPresentation () {
4554 return ItemPresentationProviders .getItemPresentation (this );
Original file line number Diff line number Diff line change 1010import com .intellij .navigation .ItemPresentationProviders ;
1111import com .intellij .openapi .diagnostic .Logger ;
1212import com .intellij .psi .PsiElement ;
13+ import io .protostuff .jetbrains .plugin .Icons ;
1314import java .util .Collection ;
1415import java .util .Collections ;
1516import java .util .Optional ;
17+ import javax .swing .Icon ;
1618import org .jetbrains .annotations .NotNull ;
19+ import org .jetbrains .annotations .Nullable ;
1720
1821/**
1922 * Field node.
@@ -85,6 +88,12 @@ public ASTNode getFieldLabelNode() {
8588 return node .findChildByType (R_FIELD_MODIFIER );
8689 }
8790
91+ @ Nullable
92+ @ Override
93+ public Icon getIcon (int flags ) {
94+ return Icons .FIELD ;
95+ }
96+
8897 @ Override
8998 public ItemPresentation getPresentation () {
9099 return ItemPresentationProviders .getItemPresentation (this );
Original file line number Diff line number Diff line change 77import com .intellij .psi .stubs .IStubElementType ;
88import com .intellij .psi .tree .IElementType ;
99import com .intellij .util .IncorrectOperationException ;
10+ import io .protostuff .jetbrains .plugin .Icons ;
1011import io .protostuff .jetbrains .plugin .psi .stubs .DataTypeStub ;
1112import java .util .ArrayList ;
1213import java .util .Arrays ;
1314import java .util .Collection ;
1415import java .util .Collections ;
1516import java .util .List ;
17+ import javax .swing .Icon ;
1618import org .jetbrains .annotations .NotNull ;
1719import org .jetbrains .annotations .Nullable ;
1820
@@ -89,6 +91,12 @@ public Collection<MessageField> getFields() {
8991 return result ;
9092 }
9193
94+ @ Nullable
95+ @ Override
96+ public Icon getIcon (int flags ) {
97+ return Icons .MESSAGE ;
98+ }
99+
92100 @ Override
93101 public ItemPresentation getPresentation () {
94102 return ItemPresentationProviders .getItemPresentation (this );
Original file line number Diff line number Diff line change 44import static io .protostuff .jetbrains .plugin .ProtoParserDefinition .rule ;
55
66import com .intellij .lang .ASTNode ;
7+ import io .protostuff .jetbrains .plugin .Icons ;
8+ import javax .swing .Icon ;
79import org .jetbrains .annotations .NotNull ;
810import org .jetbrains .annotations .Nullable ;
911
@@ -35,4 +37,11 @@ public ASTNode getMethodNameNode() {
3537 ASTNode node = getNode ();
3638 return node .findChildByType (rule (RULE_rpcName ));
3739 }
40+
41+ @ Nullable
42+ @ Override
43+ public Icon getIcon (int flags ) {
44+ return Icons .ENUM ;
45+ }
46+
3847}
Original file line number Diff line number Diff line change 66import com .intellij .navigation .ItemPresentationProviders ;
77import com .intellij .psi .PsiElement ;
88import com .intellij .psi .PsiNamedElement ;
9+ import io .protostuff .jetbrains .plugin .Icons ;
910import java .util .Arrays ;
1011import java .util .List ;
12+ import javax .swing .Icon ;
1113import org .antlr .jetbrains .adapter .psi .ScopeNode ;
1214import org .jetbrains .annotations .NotNull ;
1315import org .jetbrains .annotations .Nullable ;
@@ -36,6 +38,12 @@ public List<RpcMethodNode> getRpcMethods() {
3638 return Arrays .asList (nodes );
3739 }
3840
41+ @ Nullable
42+ @ Override
43+ public Icon getIcon (int flags ) {
44+ return Icons .SERVICE ;
45+ }
46+
3947 @ Override
4048 public ItemPresentation getPresentation () {
4149 return ItemPresentationProviders .getItemPresentation (this );
You can’t perform that action at this time.
0 commit comments