esteinberg / plantuml4idea

Intellij IDEA plugin for PlantUML
Apache License 2.0
629 stars 114 forks source link

Hyperlink to method to IntelliJ's editor #352

Closed Krivich closed 2 years ago

Krivich commented 2 years ago

Hi. I'd want to be able to jump from diagram to the source code which diagram represents. There is a working way to use IntelliJ's build-in HTTP API in pair with PlantUML's hyperlink syntax like [[http://localhost:63342/api/file/src/main/java/com/example/MyApp.java MyApp]] - and this link will open Idea's editor for the beginning of the specified file. This InetlliJ's HTTP API supports referencing to the file line number but it not supports referencing to method name which is the only one robust way. There is also a bit disappointing side-effect of this HTTP API way that every jump creates a new empty tab in web-browser. Can PlantUML plugin provides its own mechanism to jump to the method from diagram?

krasa commented 2 years ago

That sounds like something IntelliJ itself should support, is there a feature request on youtrack? PlantUML plugin could maybe skip the web-browser, when jumping from the preview.

Krivich commented 2 years ago

I'm talking to the JetBrains support.

ant-druha commented 2 years ago

AFAIU this editing support is needed inside the .puml file types. So it seems that the plugin itself, which provides the assistance for this file type, should support this navigation. There is no such a generic navigable protocol for all the file types.

krasa commented 2 years ago

@Krivich from where do you want to jump? From a web browser or from a diagram preview or from a plantuml source code?

Krivich commented 2 years ago

For me personally - from diagram preview. And jump from web browser can fix jatbrains team only.

krasa commented 2 years ago

So you could use paths like these? image

Some extra suffix matching for a method name could be implemented.

krasa commented 2 years ago

You can try it, it is really generic for all identifiers, not only methods (file.java#foo)

plantuml4idea.zip

krasa commented 2 years ago

plantuml4idea.zip

wheat2021 commented 9 months ago

Hi. It was mentioned that it is possible to navigate to a specific line in a file in IntelliJ's editor through a link, but when I set the link to include a line number, I am unable to navigate to it, like [[src/main/resources/config/process.xml:20 gotoStateEnd]]. What format should I use to enable jumping from the PlantUML plugin to a specific line of code in a designated file?

krasa commented 9 months ago

It needs to be implemented.

wheat2021 commented 9 months ago

Hello @krasa,

Thank you for your continuous efforts and contributions to the project. I would like to emphasize how much your work has positively impacted my team, providing us with invaluable tools and enhancements.

Could you kindly provide any updates on the progress of this feature? Additionally, if there is an estimated timeline for when it might be available, that information would be greatly appreciated.

krasa commented 9 months ago

@wheat2021 Thanks, it is done. But navigation from the editor does not work right, I have to consult someone if it is even possible.

wheat2021 commented 8 months ago

Hello @krasa, We appreciate your efforts in fixing the issue. We are excited to see the new feature in action and are looking forward to using it. If you need any help, please let us know. Thank you again for your efforts!