Soft question: IntelliJ, rust plugin, jump to another location

We have:

  • crate A
  • crate B
  • crateB depends on crateA

Right now, it is very easy, while browsing crateB, to jump to crateA -- put cursor over some function / struct / enum defined in crateA, hit "goto definition".

Suppose now, we are editing crateA/src/foo.rs -- is there a way to place a "bookmark" (embedded in a comment) so we can easily jump to crateB/src/bar.rs ?

So the issue here is: crateB/src/bar.rs and crateA/src/foo.rs are closely linked (but for other reasons can not be in same crate); and I want to be able to easily jump from crateA/src/foo.rs to crateB/src/bar.rs .

I can't use any code elements since crateB depends on crateA (so crateA can't depend on crateB, as that creates circular link).

Question: can I embed some type of 'bookmark/link' as a comment which IntelliJ can interpret as "goto file" ?

Does this help? Linking to items by name - The rustdoc book

This looks interesting. However, how do we get IntelliJ to "follow" rustdoc comments ?

Here's the link to the tracking issue from the neighboring ijrust thread (in case anyone drops here from google search later or something):

Feel free to upvote it to raise its priority in ijrust's backlog.

1 Like