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

Hyperlink to method to IntelliJ's editor #352

Closed
Krivich opened this issue Jun 28, 2022 · 13 comments
Closed

Hyperlink to method to IntelliJ's editor #352

Krivich opened this issue Jun 28, 2022 · 13 comments

Comments

@Krivich
Copy link

Krivich commented Jun 28, 2022

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?

@Krivich Krivich changed the title Hyperlink to method in IntelliJ's editor Hyperlink to method to IntelliJ's editor Jun 28, 2022
@krasa
Copy link
Collaborator

krasa commented Jun 28, 2022

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
Copy link
Author

Krivich commented Jun 29, 2022

I'm talking to the JetBrains support.

@ant-druha
Copy link

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
Copy link
Collaborator

krasa commented Jun 30, 2022

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

@Krivich
Copy link
Author

Krivich commented Jun 30, 2022

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

krasa added a commit that referenced this issue Jun 30, 2022
@krasa
Copy link
Collaborator

krasa commented Jun 30, 2022

So you could use paths like these?
image

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

krasa added a commit that referenced this issue Jun 30, 2022
@krasa
Copy link
Collaborator

krasa commented Jul 1, 2022

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

plantuml4idea.zip

krasa added a commit that referenced this issue Jul 1, 2022
krasa added a commit that referenced this issue Jul 1, 2022
krasa added a commit that referenced this issue Jul 1, 2022
@krasa
Copy link
Collaborator

krasa commented Jul 1, 2022

plantuml4idea.zip

@krasa krasa closed this as completed Jul 12, 2022
@wheat2021
Copy link

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
Copy link
Collaborator

krasa commented Dec 29, 2023

It needs to be implemented.

@wheat2021
Copy link

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 added a commit that referenced this issue Jan 5, 2024
krasa added a commit that referenced this issue Jan 6, 2024
krasa added a commit that referenced this issue Jan 6, 2024
@krasa
Copy link
Collaborator

krasa commented Jan 6, 2024

@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
Copy link

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!

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