Comments (8)
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.
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.
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.
@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.
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
.
from vscode-go.
@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.
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.
This is actually a better dupe of golang/go#65758.
from vscode-go.
Related Issues (20)
- gopls: automated issue report (initialization) HOT 1
- multi-root workspace scoped variables are not expanded in `go.alternateTools` HOT 1
- gopls: ignore go.work reference, use go.mod HOT 2
- Clarify unsupported Go versions in README and error messages HOT 3
- Debug:
- all: require go 1.21+ for tools installation HOT 2
- Clarify unsupported Go versions in README and error messages HOT 5
- Specify processId When Debugging with dlv-dap HOT 4
- gopls: automated issue report (crash) HOT 1
- gopls: automated issue report (crash) HOT 2
- Show a pop-up to help returning users upgrade their environments HOT 4
- Part of Syntax highlighting is lost after a few seconds HOT 1
- vscgo: retract the vscgo "module" HOT 6
- Add option(s) to disable coverage on benchmarks HOT 1
- "Go: Generate Unit Tests For Function" does not handle generics HOT 3
- gopls: automated issue report (crash) HOT 2
- Govulncheck integration test is broken with gopls v0.16.0 HOT 1
- settings wiki refers to deprecated `go.languageServerExperimentalFeatures` HOT 3
- Use GOTOOLCHAIN=auto in gopls update logic HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-go.