VSC go to definition not working for external package

xuanbao · · 650 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I just installed visual studio code with golang on my macbook but I can&#39;t get &#34;go to definition&#34; to work for external packages. I had it working on my windows pc and it works for a colleague of mine. I have intellisense for these packages. Someone has any idea what can be causing this?</p> <hr/>**评论:**<br/><br/>rr1pp3rr: <pre><ul> <li>Is your go plugin installed?</li> <li>Is your go version configured?</li> <li>Did you run vscode with the proper GOPATH environment variable?</li> </ul> <p>I remember having to run some command in vscode to have a &#39;code&#39; command line app which would launch it, so that it would have my GOPATH from my shell when it ran.</p></pre>Muanh: <pre><p>I got it to work for the most part, for one package it is still not working (gorilla/mux).</p></pre>rr1pp3rr: <pre><p>I&#39;ve contributed to that package. Stopped using it when I put in a pr to fix their broken http codes on invalid matches, and after much bs they just let it sit there.</p> <p>Switched to gocraft web and haven&#39;t looked back. My contributions there were really accepted. Yay for explicit context!</p> <p>Edit: lol I just looked and the pr is still open! Hahahahaha </p></pre>picardo: <pre><blockquote> <p>I remember having to run some command in vscode to have a &#39;code&#39; command line app which would launch it, so that it would have my GOPATH from my shell when it ran.</p> </blockquote> <p>I think I need to do something similar to this. Do you have a link that gives a more in-depth explanation of how to do that? </p></pre>rr1pp3rr: <pre><p><a href="http://stackoverflow.com/questions/29971053/how-to-open-visual-studio-code-from-the-command-line-on-osx" rel="nofollow">http://stackoverflow.com/questions/29971053/how-to-open-visual-studio-code-from-the-command-line-on-osx</a></p></pre>Matthias247: <pre><p>For me it&#39;s working for packages that are in the gopath and the standard library, but unfortunately it&#39;s not yet working for vendored packages. Maybe you have one of those?</p></pre>Muanh: <pre><p>I think it is related to this. I pulled the source from our repository. But even after I go get all the packages it is still not working for that one package.</p></pre>dsiemon: <pre><p>Did you &#39;go install&#39; it? This is required to get code completion with vim-go.</p></pre>Muanh: <pre><p>Thanks, I can try that. I&#39;ll let you know in a few days when I&#39;m back at the office.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

650 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传