obiwan87 / odin-intellij

Odin Support plugin for JetBrains IDEs
https://plugins.jetbrains.com/plugin/22933-odin-support
MIT License
37 stars 3 forks source link

Idea: Allow 'Goto declaration' when triggered on the import string to show the directory the package is in? #62

Closed Dima-369 closed 1 month ago

Dima-369 commented 2 months ago

Very minor thing.

I realized that triggering 'Goto declaration' on the import statement shows all usages of the package, which is amazing! I then tried it on the string after and no information was given, so I thought if maybe the directory to the package could be shown in that tooltip? Or just jumping to the first source file in the package?

CleanShot 2024-08-16 at 08 16 59@2x

obiwan87 commented 2 months ago
  1. With no alias it works with the beginning of the import statement. There it finds the places where import is used. I couldn't find a way to tie a string literal to a declaration yet
  2. The behavior you suggest was something I thought of. I will check how the Go IDE behaves
obiwan87 commented 2 months ago

Ok, after some research I think I figured out the best practice:

In order for this to work, first, we have to add the SDK path as external library

https://plugins.jetbrains.com/docs/intellij/workspace-model.html

obiwan87 commented 2 months ago

This features has been implemented as described above :)

Dima-369 commented 2 months ago

This features has been implemented as described above :)

Nice, works well!