3

I have a code in go, and I am using IntelliJIdea for development. It used to work fine, but since the time I have changed the folder where the code used to be, IntelliJ has been behaving in a weird manner. It shows me a lot of unable to find declaration to go to errors. After changing the folder where my project used to be, I changed the GOPATH and imported from the new directory once again.

I am attaching the screenshot as that will be better for understanding.

See the conductor.Start(). This function is right there in the package app. But it can't find this.

PS: I have tried importing the project from scratch and invalidating and restarting multiple times, but that didn't help.

John Dui
  • 541
  • 3
  • 8
  • 15

3 Answers3

2

I'm using Gogland, which is also a JetBrains IDE, but I also had a problem with symbols not getting resolved.

I fixed it by deleting the project's index file.

  1. Close the IDE.
  2. In your project directory, find a directory named ".idea".
  3. Delete all files with the extension ".iml" in that directory.
  4. Restart the IDE.

The project should get reindexed and symbols will be resolved.

https://www.jetbrains.org/intellij/sdk/docs/basics/project_structure.html?search=.iml

Rich Sutton
  • 10,004
  • 1
  • 17
  • 21
  • this worked. However, I had to perform one additional step after 4, to manually add back .iml file, as it was not created automatically. – user7630232 Dec 09 '20 at 07:10
  • I also had to manually put back the .iml file but it still didn't work for me. – molundb Nov 14 '22 at 09:28
0

For my case, Intellij didn't have Rust installed. I found that out while trying to create a new project (it had JAVA and other language support). As soon as I installed Rust, it worked.

Coder
  • 1,415
  • 2
  • 23
  • 49
-1

For my case, I have 2 virtual environments, and I found that I did not set the correct environment in Pycharm. The environment I used did not include these packages. After I changed the environment, everything goes well.

Jingnan Jia
  • 1,108
  • 2
  • 12
  • 28