coc-java icon indicating copy to clipboard operation
coc-java copied to clipboard

Go to definition for protos

Open nakulj opened this issue 4 years ago • 1 comments

It would be great if there was some way to directly jump to the source proto file when hovering under a symbol generated from a proto.

This could be done by 'post processing' the code location returned by the language server. Generated proto classes usually have this comment at the top:

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: foo.proto

It shouldn't be too hard to take a symbol like Foo.barBaz, transform it into the proto name Foo.bar_baz, and then look for it in the file pointed to by the comment.

Is coc-java the right place for this, or should this go in a different layer of the stack? If I wanted to write a PR for this functionality, where would I start?

nakulj avatar Aug 25 '21 16:08 nakulj

:h CocAction('definitionHover') it requires server returns definitionLink for definition request Another problem is coc.nvim doesn't support parse location with jdk protocol

chemzqm avatar Aug 25 '21 17:08 chemzqm

Need support by language server

chemzqm avatar Jan 29 '23 06:01 chemzqm

Use command :CocList -I --input=Foo.bar_baz symbols to search symbols.

chemzqm avatar Jan 29 '23 09:01 chemzqm