Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to display help text? #30

Open
tgulacsi opened this issue Nov 9, 2016 · 9 comments
Open

How to display help text? #30

tgulacsi opened this issue Nov 9, 2016 · 9 comments

Comments

@tgulacsi
Copy link
Contributor

tgulacsi commented Nov 9, 2016

As I've investigated, the comments before the field (in the .proto file) are read and provided to Builder.
But I don't see this appear anywhere.
There's a "setLink" in the js code, but nowhere called.

What do I miss?

@awalterschulze
Copy link
Member

There should be a little question mark next to your field.
When you hover over this your text should be displayed.
Does this not work for you?
If not please provide a sample file for which this does not work.

@tgulacsi
Copy link
Contributor Author

tgulacsi commented Nov 9, 2016

cd /tmp
unzip letme-30.zip
"protoc" "--letmegrpc_out=plugins=grpc:/tmp/src" "--proto_path=/tmp/src:." "/tmp/src/unosoft.hu/ws/bruno/pb/portal/portal.proto"

letme-30.zip

and the generated /tmp/src/unosoft.hu/ws/bruno/pb/portal/portal.letmegrpc.go does not contain help, though /tmp/src/unosoft.hu/ws/bruno/pb/db_web/db_web.proto does contains comments.

@awalterschulze
Copy link
Member

setLink is only used to non repeated messages.
You should be looking for "tooltip"

@awalterschulze
Copy link
Member

Or rather data-toggle="tooltip"

@awalterschulze
Copy link
Member

awalterschulze commented Nov 13, 2016

help := g.Comments(fmt.Sprintf("%s,%d,%d", msg.Path(), 2, i))

Is used to get the comment, where i is the field index.

@awalterschulze
Copy link
Member

The Comments method describes has this documentation

// Comments returns any comments from the source .proto file and empty string if comments not found.
// The path is a comma-separated list of intergers.
// See descriptor.proto for its format.

@awalterschulze
Copy link
Member

awalterschulze commented Nov 13, 2016

I found this in the descriptor.proto

message SourceCodeInfo {
  // A Location identifies a piece of source code in a .proto file which
  // corresponds to a particular definition.  This information is intended
  // to be useful to IDEs, code indexers, documentation generators, and similar
  // tools.
  //
  // For example, say we have a file like:
  //   message Foo {
  //     optional string foo = 1;
  //   }
  // Let's look at just the field definition:
  //   optional string foo = 1;
  //   ^       ^^     ^^  ^  ^^^
  //   a       bc     de  f  ghi
  // We have the following locations:
  //   span   path               represents
  //   [a,i)  [ 4, 0, 2, 0 ]     The whole field definition.
  //   [a,b)  [ 4, 0, 2, 0, 4 ]  The label (optional).
  //   [c,d)  [ 4, 0, 2, 0, 5 ]  The type (string).
  //   [e,f)  [ 4, 0, 2, 0, 1 ]  The name (foo).
  //   [g,h)  [ 4, 0, 2, 0, 3 ]  The number (1).

@awalterschulze
Copy link
Member

Maybe the SourceCodeInfo is being passed along and letmegrpc is unable to get the comments

@awalterschulze
Copy link
Member

That doesn't seem to be the problem.

How do I run your code?
I would like to see the Chrome debug information.
Maybe its not escaping something correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants