Git Product home page Git Product logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 19, 2024
Can't say I've used that syntax before - it's not clear to me what it's doing, 
as that doesn't appear to be applying the option to the *field* (which it's 
doing in the first one). However, we don't do any parsing ourselves - we just 
delegate to protoc. So if it works in protoc, that should be fine for 
protobuf-csharp-port too.

Original comment by jonathan.skeet on 20 Jul 2011 at 5:24

from protobuf-csharp-port.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 19, 2024
I admit I still don't really grok what's going on here, but fortunately I have 
collaborators who do :) Explanation from Roger:

The language guide for protobuffers has some information on this:

http://code.google.com/apis/protocolbuffers/docs/proto.html#options

Specifically it states: "Note that if you want to use a custom option in a 
package other than the one in which it was defined, you must prefix the option 
name with the package name, just as you would for type names."

This is the reason that you see the qualifier "google.protobuf.".  The reason 
for the "csharp_field_options" is that the option itself is a message not a 
field.  So the syntax you wrote works when you are accessing a field extension 
of message from the same package:

extend google.protobuf.MessageOptions { 
    optional int32 msg_type = 50001; 
}
message Msg {
    option (msg_type) = 11;
    required string name = 1;
    required string pswd = 2;
}

-----

I'm closing this as WontFix as I can't see that it's anything that this code 
base could change either way.

Original comment by jonathan.skeet on 13 Aug 2011 at 6:33

  • Changed state: WontFix

from protobuf-csharp-port.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 19, 2024
yes, i can use it with the type before.
Thanks a lot.

Original comment by [email protected] on 19 Aug 2011 at 6:41

from protobuf-csharp-port.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.