Youcompleteme: GOLANG can not use the YCM to find the tags in my own package(GRPC file`s tag)

Created on 4 Sep 2016  路  8Comments  路  Source: ycm-core/YouCompleteMe

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside
the brackets) _before_ filing your issue:

  • [x] I have read and understood YCM's CONTRIBUTING document.
  • [x] I have read and understood YCM's CODE_OF_CONDUCT document.
  • [x] I have read and understood YCM's README, especially the
    Frequently Asked Questions section.
  • [x] I have searched YCM's issue tracker to find issues similar to the one I'm
    about to report and couldn't find an answer to my problem. (Example Google
    search.
    )
  • [x] If filing a bug report, I have included the output of vim --version.
  • [x] If filing a bug report, I have included the output of :YcmDebugInfo.
  • [x] If filing a bug report, I have included the output of
    :YcmToggleLogs stderr.
  • [x] If filing a bug report, I have included which OS (including specific OS
    version) I am using.
  • [x] If filing a bug report, I have included a minimal test case that reproduces
    my issue.
  • [x] I understand this is an open-source project staffed by volunteers and
    that any help I receive is a selfless, heartfelt _gift_ of their free time. I
    know I am not entitled to anything and will be polite and courteous.
  • [x] I understand my issue may be closed if it becomes obvious I didn't
    actually perform all of these steps.

Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.

Issue Details

[If filing a bug report, please include a list of steps that describe how to
reproduce the bug you are experiencing. Also include test code if relevant.]

I use the grpc to generate the proto file and import them in my project. But i cannot let the tags be complete by the ycm _ONLY IF I open that file_. Is there any way to make the YCM cache the tags automaticly or auto open the file which I import? How to make those tags which is in my import file (like grpc generate file) can be found automaticly?

Most helpful comment

You mean the YCM will find the tags in the library (.a file) from my GOPATH/pkg right? So I should go install the third party package to make it be detected by YCM?

Yes and yes. See https://github.com/nsf/gocode/issues/256#issuecomment-62679489 from Gocode author.

All 8 comments

here is some screen cut

1) keyin the . and callout the list
image
but there is nothing i need

2) after I open the file where the package was difined, they come out!
image

3) I paste some line about my vimrc file here
image

I wonder if I get something wrong with the config or something else.
Is there any way to make it easy and convenient to use YCM with go?
thx a lot

Please read and supply the details requested in CONTRIBUTING.md.

thx for reply me, now I HAVE read those docs

@arthurkiller Suggestions in your screenshots come from the identifier completer (indicated by the [ID] tag). From the documentation:

an identifier-based completer that collects all of the identifiers in the current file and other files you visit (and your tags files) and searches them when you type (identifiers are put into per-filetype groups).

What you really want is suggestions from the semantic completer. For the Go language, YCM use the gocode completion engine. To enable it, you need to install YCM with the --gocode-completer parameter:

./install.py --gocode-completer

Did you install it this way?

Sure, I do have install YCM with the --gocode-completer
But it doesn`t work.
Do I need to turn off the identifier of tags?

Do I need to turn off the identifier of tags?

No, we need to figure out why Gocode is not providing completions.

Did you install your proto file (.pb.go) with go install? This is required if you want completions from it because Gocode does not look at the sources but at the libraries. This is what I did with the grpc hello world example and it works.

Thx for reply.
I run go install and it works!
You mean the YCM will find the tags in the library (.a file) from my GOPATH/pkg right? So I should go install the third party package to make it be detected by YCM?

You mean the YCM will find the tags in the library (.a file) from my GOPATH/pkg right? So I should go install the third party package to make it be detected by YCM?

Yes and yes. See https://github.com/nsf/gocode/issues/256#issuecomment-62679489 from Gocode author.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jsdevel picture jsdevel  路  4Comments

Bercio picture Bercio  路  5Comments

d0u9 picture d0u9  路  4Comments

hkurj picture hkurj  路  3Comments

Jzarecta picture Jzarecta  路  4Comments