File tree Expand file tree Collapse file tree 4 files changed +32
-1
lines changed
main/java/io/protostuff/jetbrains/plugin/reference
java/io/protostuff/jetbrains/plugin/rename/field Expand file tree Collapse file tree 4 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ dependencies {
3232 exclude group : ' com.jetbrains'
3333 }
3434 compile ' com.google.guava:guava:21.0'
35- compile ' io.protostuff:protostuff-parser:2.1.9 '
35+ compile ' io.protostuff:protostuff-parser:2.1.11 '
3636}
3737
3838apply plugin : ' idea'
Original file line number Diff line number Diff line change 66import static io .protostuff .compiler .model .ProtobufConstants .MSG_FILE_OPTIONS ;
77import static io .protostuff .compiler .model .ProtobufConstants .MSG_MESSAGE_OPTIONS ;
88import static io .protostuff .compiler .model .ProtobufConstants .MSG_METHOD_OPTIONS ;
9+ import static io .protostuff .compiler .model .ProtobufConstants .MSG_ONEOF_OPTIONS ;
910import static io .protostuff .compiler .model .ProtobufConstants .MSG_SERVICE_OPTIONS ;
1011
1112import com .google .common .base .Strings ;
2728import io .protostuff .jetbrains .plugin .psi .MapNode ;
2829import io .protostuff .jetbrains .plugin .psi .MessageField ;
2930import io .protostuff .jetbrains .plugin .psi .MessageNode ;
31+ import io .protostuff .jetbrains .plugin .psi .OneOfNode ;
3032import io .protostuff .jetbrains .plugin .psi .ProtoPsiFileRoot ;
3133import io .protostuff .jetbrains .plugin .psi .ProtoRootNode ;
3234import io .protostuff .jetbrains .plugin .psi .RpcMethodNode ;
@@ -66,6 +68,7 @@ public class FieldReferenceProviderImpl implements FieldReferenceProvider {
6668 .put (RpcMethodNode .class , MSG_METHOD_OPTIONS )
6769 .put (ServiceNode .class , MSG_SERVICE_OPTIONS )
6870 .put (ProtoRootNode .class , MSG_FILE_OPTIONS )
71+ .put (OneOfNode .class , MSG_ONEOF_OPTIONS )
6972 .build ();
7073
7174 public FieldReferenceProviderImpl (Project project ) {
Original file line number Diff line number Diff line change @@ -25,6 +25,13 @@ public void testRenameField_caretAtFieldName() {
2525 Assert .assertNotNull (option );
2626 }
2727
28+ public void testRenameField_caretAtFieldName_OneofOption () {
29+ myFixture .configureByFiles ("rename/field/RenameField_CaretAtField_OneofOption.proto" );
30+ myFixture .renameElementAtCaret ("NewName" );
31+ OptionNode option = myFixture .findElementByText ("(foo).NewName" , OptionNode .class );
32+ Assert .assertNotNull (option );
33+ }
34+
2835 public void testRenameField_caretAtOption () {
2936 myFixture .configureByFiles ("rename/field/RenameField_CaretAtOption.proto" );
3037 myFixture .renameElementAtCaret ("NewName" );
Original file line number Diff line number Diff line change 1+ syntax = "proto2" ;
2+
3+ package rename.field ;
4+
5+ import "google/protobuf/descriptor.proto" ;
6+
7+
8+ extend google.protobuf.OneofOptions {
9+ optional Foo foo = 52003 ;
10+ }
11+
12+ message Foo {
13+ optional int32 name<caret> = 1;
14+ }
15+
16+ message Bar {
17+ oneof oneof {
18+ option (foo).name = 1 ;
19+ optional string field = 1 ;
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments