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

Exclude certain projects from indexing/GOPATH library #2888

Open
ksrb opened this issue Apr 27, 2017 · 5 comments
Open

Exclude certain projects from indexing/GOPATH library #2888

ksrb opened this issue Apr 27, 2017 · 5 comments

Comments

@ksrb
Copy link

ksrb commented Apr 27, 2017

This project is unmaintained work has moved to IDEA

I've duplicated this issue in https://youtrack.jetbrains.com/issue/GO-3983 please 👍 there if you want to see this feature in a future release.


This is more of a feature request but it would be helpful if there was a way to exclude certain projects from indexing on the $GOPATH library.

The use case for this that my $GOPATH has several projects that are unrelated to the project I'm currently working but indexing occurs across the entire$GOPATH, which is processor intensive/time consuming.

A feature like this was 'suggested' in another issue and one of the responses was that go build does not allow you to exclude certain projects from being build. This is true however, go build does not incur any penalty as it does not read dependencies that are not required unlike IntelliJ's indexing.

I understand that such a feature may result in unexpected behavior, but it would be a fairly advanced feature and I would expect users who are looking for such a optimization to know what they're doing.

  • Plugin version: 0.171.2
  • IDE name and version: IntelliJ IDEA 2017.1.2 Build #IU-171.4249.39, built on April 25, 2017
  • Java version: 1.8.0_112-release-736-b16 x86_64
  • OS name and version: Mac OS X 10.11.6
@ggicci
Copy link

ggicci commented May 10, 2017

Please give us a chance to choose which projects under $GOPATH to index. Indexing the whole $GOPATH almost kills everything.

@tbh1
Copy link

tbh1 commented May 27, 2017

I have this need as well. The plugin is currently indexing all projects on my $GOPATH, which includes many large projects that are unrelated to my current work. It seems like a better approach would be to index external projects as they are imported by the current project. NodeJS dependencies from external projects are also being imported during this process.

Also, this severely affects things like refactoring, smart delete, etc. For example, in an empty Go project with a single main.go file, moving the file to a new folder causes the entire index to be scanned. With my setup with throws an out of memory error.

I personally keep all of my projects (Go, java, nodejs, etc) in the same GOPATH hierarchy for consistency. This plugin is currently unusable with such a configuration.

intellij-go-indexing

intellij-go-out-of-memmory-refactor

@dlsniper
Copy link
Member

Hi,

It is highly unlikely that this, the community plugin, will likely not get support for this in the near future (as it's currently unmaintained).

However, the JetBrains developed plugin, https://plugins.jetbrains.com/plugin/9568-go, or IDE, https://www.jetbrains.com/go/ , has an issue on the tracker which will help with this, https://youtrack.jetbrains.com/issue/GO-2855

The upcoming release for IntelliJ IDEA, 2017.2, will include this feature: https://youtrack.jetbrains.com/issue/IDEA-127753 which might help you with this.

As for refactoring, technically the plugin / IDE are doing the right thing as the project is part of the whole GOPATH and there's no way to tell if the project currently used in other projects from GOPATH or not unless that is detected.

Hope it helps.

@ksrb
Copy link
Author

ksrb commented Jun 9, 2017

Thanks for responding I didn't realize that this project wasn't being maintained any more and Jetbrains developers had moved out of github 😞, I find Youtrack a bit unwieldy in comparison.

Unfortunately the issue you mentioned 'Ability to exclude files from indexing in a path by their names (full paths) or by pattern' doesn't seem to work in go plugin.

I've opened a Youtrack bug to see if this can be fixed.

Related Youtrack issues:

Should this issue be closed?

@dlsniper
Copy link
Member

dlsniper commented Jun 9, 2017

This issue is still present in the open source plugin and will be present until someone fixes it. Not sure who will do it, but that's a different story.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants