Git Product home page Git Product logo

Comments (8)

findleyr avatar findleyr commented on August 18, 2024

Hi, what is your gopls version? This should have been fixed in [email protected].

Please run gopls -v version and share the output.

from vscode-go.

wayneforrest avatar wayneforrest commented on August 18, 2024

Hi @findleyr here is my versions:

golang.org/x/tools/gopls v0.15.3 golang.org/x/tools/[email protected] h1:zbdOidFrPTc8Bx0YrN5QKgJ0zCjyGi0L27sKQ/bDG5o= github.com/BurntSushi/[email protected] h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= github.com/google/[email protected] h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= golang.org/x/exp/[email protected] h1:2O2DON6y3XMJiQRAS1UWU+54aec2uopH3x7MAiqGW6Y= golang.org/x/[email protected] h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= golang.org/x/[email protected] h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/[email protected] h1:vcVnuftN4J4UKLRcgetjzfU9FjjgXUUYUc3JhFplgV4= golang.org/x/[email protected] h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/[email protected] h1:uH9jJYgeLCvblH0S+03kFO0qUDxRkbLRLFiKVVDl7ak= golang.org/x/[email protected] h1:KUas02EjQK5LTuIx1OylBQdKKZ9jeugs+HiqO5HormU= honnef.co/go/[email protected] h1:oFEHCKeID7to/3autwsWfnuv69j3NsfcXbvJKuIcep8= mvdan.cc/[email protected] h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo= mvdan.cc/xurls/[email protected] h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8=

from vscode-go.

findleyr avatar findleyr commented on August 18, 2024

Thanks. This doesn't reproduce for me. When I create a main_windows.go, gopls indeed works as expected -- for example I can jump to definition.

Can you share exact steps to reproduce? Are you just creating a main_windows.go file in an empty workspace folder?

from vscode-go.

wayneforrest avatar wayneforrest commented on August 18, 2024

@findleyr thank you for assisting. I will only be able to try this later tonight. I will then experiment and see what is going on.

I also have a main_darwin.go file together with a main_windows.go file, and both then reach out to normal go files.
I can navigate from the darwin file, but not from my windows file. (Also this is done from MacOS). Perhaps some environment vars are at play here?

But I will try again tonight, and get back with more details (it might just be this project).

from vscode-go.

wayneforrest avatar wayneforrest commented on August 18, 2024

Hi @findleyr, I have managed to reproduce the problem. (well I think so).

1: create two files. main_windows.go and main_darwin.go, both having func main() defined in them.
2: create a package called callme, and in it a func CallMe() { fmt.Println("called me") }
3: in both files add a import "C" line
4: call the function callme.CallMe() from within the main function.

As soon as I add the import "C", I am unable to navigate, from the main_windows.go file, to the function definition of CallMe(), by using the command key and the mouse:CMD+Mouse+Click.

image

from vscode-go.

suzmue avatar suzmue commented on August 18, 2024

@wayneforrest Thanks for the repro, I was able to reproduce the issue locally when using cgo as well.

@findleyr this comment from the zero-config issue seems to refer to this same problem.

from vscode-go.

findleyr avatar findleyr commented on August 18, 2024

This is indeed a known issue. Setting GOOS or GOARCH do a cross-platform value implies CGO_ENABLED=0 (because we have no C compiler).

We could do better here, but that is covered under #35721 among other issues. Closing as a dupe.

(Since this was just raised again, I'm going to experiment with using go/types.Config.FakeImportC to work around this issue).

from vscode-go.

findleyr avatar findleyr commented on August 18, 2024

This is actually a better dupe of golang/go#65758.

from vscode-go.

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.