Closed GoogleCodeExporter closed 9 years ago
Original comment by alr...@google.com
on 13 Sep 2011 at 10:22
Original comment by alr...@google.com
on 13 Sep 2011 at 10:22
Sorry the test files were no good, i had a typo in there, fixed in the new
upload.
Original comment by compuwar...@gmail.com
on 14 Sep 2011 at 10:59
Attachments:
Updated the proposal provider to be consistent with validating / scoping...
needed two added components...
@Inject private ProtobufScopeProvider scopeProvider;
and
@Override
public void completeLiteralRef_Literal(EObject model, Assignment assignment,
ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
Enum enumType = scopeProvider.enumTypeOfOption(model);
if (enumType != null) {
proposeAndAccept(enumType, context, acceptor);
return;
}
}
I also had to make ..."scopeProvider.enumTypeOfOption()" public to share access.
This definitely has the feel of a partial solution begging to be fully
implemented for the rest of MessageNotation... I might take a shot at that when
I have some free time unless someone else is already looking into solutions for
that...
Original comment by compuwar...@gmail.com
on 14 Sep 2011 at 11:05
Attachments:
Tacking on two more issues to this issue... if preferred I can make separate
issues but I tend to be of the "related issues in one issue > issue spam"
court...
Repeated fields result in a syntax error in MessageNotation
using a repeated field such as
import "descriptor.proto";
extend google.protobuf.FieldOptions {
optional MyCustomOptionType myoption = 50000;
}
message MyCustomOptionType {
repeated int32 myrepeatedfield = 1;
}
message MyMessage {
optional int32 foo = 1 [(myoption)= {
myrepeatedfield: 12 ,
myrepeatedfield: 24 ,
myrepeatedfield: 48
} ];
results in a syntax error due to unique name enforcement by XText
This is fixed simply by not using the special "name" variable in XText:
FieldNotation:
(fieldName=QualifiedName | extension?='[' fieldName=QualifiedName ']') ':' value=SimpleRef;
Lack of commas between fields in MessageNotation result in a syntax error
Commas are not required between fields in message notation by protoc. This
should be reflected in protobuf-dt.
optional int32 bar = 2 [(myoption)= {
myrepeatedfield: 12
myrepeatedfield: 24
myrepeatedfield: 48
} ];
optional int32 badprogrammer = 3 [(myoption)= {
myrepeatedfield: 12
myrepeatedfield: 24 , //this is still 'valid'...
myrepeatedfield: 48
} ];
Simple fix is to make commas optional...
MessageNotation:
'{'
fields+=FieldNotation (','? fields+=FieldNotation)*
'}'
;
Original comment by compuwar...@gmail.com
on 14 Sep 2011 at 11:39
Attachments:
Also, I updated to the 1.0.2 release - the changes had no effect on the problem
nor solution.
Original comment by compuwar...@gmail.com
on 14 Sep 2011 at 11:44
As an added note here, with these proposed changes implemented all valid
message notation in custom options *should* be free of errors in the editor.
That is not to say that all message notation will be properly validated -
invalid notation could still appear valid (use int instead of string, etc).
Original comment by compuwar...@gmail.com
on 14 Sep 2011 at 11:47
Correction to my previous note... nested message types in custom options are
not supported by the grammar. This issue is addressed separately in
https://code.google.com/p/protobuf-dt/issues/detail?id=121
Original comment by compuwar...@gmail.com
on 15 Sep 2011 at 7:49
I believe this issue and solution are superseded by
https://code.google.com/p/protobuf-dt/issues/detail?id=125
and should be closed / rejected if and when that addresses the issues raised
here.
Original comment by compuwar...@gmail.com
on 30 Sep 2011 at 6:11
I believe this issue and solution are superseded by
https://code.google.com/p/protobuf-dt/issues/detail?id=125
and should be closed / rejected if and when that addresses the issues raised
here.
Original comment by compuwar...@gmail.com
on 30 Sep 2011 at 6:11
Postponing fix to next release.
Original comment by alr...@google.com
on 12 Oct 2011 at 6:04
Original comment by alr...@google.com
on 18 Oct 2011 at 7:58
Original comment by alr...@google.com
on 3 Nov 2011 at 1:06
Fixed as Issue 155. I started working on full support of custom options based
on bugs filed internally at Google, as I kept working on it I ended fixing this
issue as well.
r3bc2f7ac4c7c, r96a713437062, r3216303da8e9, reca7b70fcd9a, r2f429441e726,
r90b9a83fd09c, r12ee03ab3bfb, r5268fff7f929, rc209d861a5b7, rde0f3163a72d,
r170e19933ee3, rb7bf6780440a, rfdb47648d534, r60501de66435
Original comment by alr...@google.com
on 22 Nov 2011 at 1:18
Original issue reported on code.google.com by
compuwar...@gmail.com
on 13 Sep 2011 at 6:41Attachments: