Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

Outline not working as expected for custom build tag #222

Open
nirajbhatt7 opened this issue Aug 23, 2016 · 5 comments
Open

Outline not working as expected for custom build tag #222

nirajbhatt7 opened this issue Aug 23, 2016 · 5 comments

Comments

@nirajbhatt7
Copy link

I am using custom build tag in some of my GO files. The issue is that "Outline" panel in Eclipse shows error when the build tag is enabled. I was expecting "Outline" not to show error irrespective of the tag is // +build local or // +build !local

Is there a setting that I am missing or is this a bug?

Build Command:
${GO_TOOL_PATH} install -tags local -v -gcflags "-N -l" github.com/nirajbhatt7/Sample

sample.go
// +build local

Note: There is a blank line after the build. This builds the project and includes the sample.go but the "Outline" in Eclipse shows an error "Error parsing 'guru describe' result, for source structure update package ......"

sample.go
// +build !local

Note: This builds the project and does not include the sample.go. "Outline" in Eclipse does not show any error.

@bruno-medeiros
Copy link
Contributor

Hum, I didn't noticed that issue before. The thing is, the build command does not affect how guru is called, so guru won't be called with -tags local. Ideally guru should always display an outline regardless of build tags, but it doesn't do that.

We could add an option to pass a -tags parameter to guru, but I think that's not very appropriate. What if different go files have different build tags. We would need to configure tags for each individually.

@bruno-medeiros
Copy link
Contributor

I'm trying to think of a better workaround for Goclipse. Perhaps best is to scan the start of the Go file, see if there is any "// +build" command, remove that line if there is one (in a temporary Go file), and call guru describe on that file.

@jonpaul
Copy link

jonpaul commented Oct 3, 2016

I also just ran into this issue, an error like this one: Error parsing 'guru describe' result, for source structure update: no buildable Go source files in /var/folders/hg/k89sj9rs0v1748v1z88h4czh0000gp/T/_goclipse6030531029753758149/src/describe_temp

Kept being generated. This was super confusing until I found this issue. It would sound like the temporary file missing some of the //build lines would be the most simple way forward.

@lazytiger
Copy link

Same problem here. I find that any file contains "import C" will fail to show outline.

@bruno-medeiros
Copy link
Contributor

@lazytiger your problem is different, see #176 . That one I'm afraid cannot be fixed on Goclipse side.

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

4 participants