Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/internal/lsp: gopls breaks with C dependencies #32416

Closed
marwan-at-work opened this issue Jun 3, 2019 · 1 comment
Closed

x/tools/internal/lsp: gopls breaks with C dependencies #32416

marwan-at-work opened this issue Jun 3, 2019 · 1 comment
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls.
Milestone

Comments

@marwan-at-work
Copy link
Contributor

Gopls (on vscode) fails to compile and autocomplete when using gocv.io/x/gocv as a dependency in your program.

To reproduce:

  1. Follow the installation instructions here: https://gocv.io/getting-started/macos/
  2. Create a Go program outside GOPATH with a go.mod file
  3. Paste the following into main.go:
package main

import (
	"gocv.io/x/gocv"
)

func main() {
	webcam, _ := gocv.VideoCaptureDevice(0)
	window := gocv.NewWindow("Hello")
	img := gocv.NewMat()

	for {
		webcam.Read(&img)
		window.IMShow(img)
		window.WaitKey(1)
	}
}

From a terminal: run go run main.go and notice that it works by opening your camera.

However, notice that in VSCode, Gopls is unable to find any of the functions in this file:

Screen Shot 2019-06-03 at 5 06 51 PM

Gopls version:

commit aa71c3f32488bfee7774668abdf1ae045e013079 (HEAD -> master, origin/master, origin/HEAD)
Author: Rebecca Stambler <rstambler@golang.org>
Date:   Tue May 28 18:13:06 2019 -0400

    internal/lsp: set env to os.Environ to start
@marwan-at-work marwan-at-work added the gopls Issues related to the Go language server, gopls. label Jun 3, 2019
@gopherbot gopherbot added this to the Unreleased milestone Jun 3, 2019
@marwan-at-work
Copy link
Contributor Author

duplicate of #31561

will re open if 31561 is solved and this is still an issue.

@golang golang locked and limited conversation to collaborators Jun 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls.
Projects
None yet
Development

No branches or pull requests

2 participants