Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

the debugging tool is ignoring the go.buildTags parameter #1117

Closed
ilosc opened this issue Jul 26, 2017 · 9 comments
Closed

the debugging tool is ignoring the go.buildTags parameter #1117

ilosc opened this issue Jul 26, 2017 · 9 comments

Comments

@ilosc
Copy link

ilosc commented Jul 26, 2017

The debugging tool seems to be ignoring the value of the parameter go.buildTags. Running test functions does consider it, though. Using the file launch.json I can solve this problem by setting the buildFlags parameter, but I'd like to use codelens, which are quicker. Is this a bug?

@ramya-rao-a
Copy link
Contributor

We can add the values of go.buildFlags and go.testFlags settings (which combined get used when running tests) to the buildFlags parameter of the debug config that gets used by the codelens.

Thats pretty easy to do.
Use https://github.com/Microsoft/vscode-go/blob/master/src/goTest.ts#L309 to get the flags and pass it to the debug config being formed here: https://github.com/Microsoft/vscode-go/blob/master/src/goRunTestCodelens.ts#L78

PRs are welcome if anyone wants to give this a try.

@ramya-rao-a
Copy link
Contributor

This feature is now out in the latest update to the Go extension 0.6.64

The debug code lens will now honor the go.buildFlags, go.buildTags and go.testFlags settings.

@ilosc
Copy link
Author

ilosc commented Sep 13, 2017

I'm using the extension 0.6.65 and I'm still having problems. Specifically, I need to use the "fts5" module of SQLite. To this end, in the workspace settings file, I'm including "go.testFlags" as follows:

"go.testFlags": ["-tags", "fts5"]

I'm also including the line:

"go.buildTags": "fts5"

However, when I run tests using codelens, the "fts5" module fails to load.

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Sep 13, 2017

@ijlopez02

Do you need to use it both for testing and normal building, then don't include it in test flags, just use
"go.buildTags": "fts5"

@ilosc
Copy link
Author

ilosc commented Sep 13, 2017

Sorry, running tests using codelens works. What is still failing me is debugging through codelens.

@ramya-rao-a
Copy link
Contributor

So are you using go.testFlags or go.buildTags ?

@ilosc
Copy link
Author

ilosc commented Sep 14, 2017

I'm using "go.buildTags". I've defined the option within both the user-serttings and the workspace-settings files (just to be sure). I've also tried other options and combinations, but debugging using codelens seems to be ignoring them:

 no such module: fts5

Running tests using codelens is generating the correct command, though.

 go test -timeout 30s -tags fts5 -run ^Test...$

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Oct 2, 2017

@ijlopez02 In the latest update to the Go extension, the buildTags will be used by the debug code lens correctly
Thanks @ka2n for the fix!

@ilosc
Copy link
Author

ilosc commented Oct 4, 2017

Great! Thank you both very much @ramya-rao-a and @ka2n

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants