First help request to develop a plugin with project files analysis and interactive diagramming
Hi, Thanks for this beautiful product. I want to create a intellij plugin but I would like explanation.
The plugin should be able to:
- execute a command when right clicking a file from the projet view,
- then the command should then read/execute the file (.js file) to perform an analysis and produce some data
- then the data should be used as input to display a diagram in the same way that the existing "Diagrams / show diagram..." feature
- so the diagram contain clickable elements that will allow to navigate back to certain files in the project.
Can you please describe for me a first big picture about how this should be performed? I am an experimented dev but I never wrote any jetbrain plug-in.
How a plugin can add a button in the project view contextual menu?
Can I code a plugin in javascript?
Can I run code from the current opened javascript project?
Can a plugin reuse the same yFiles features like in the intellij "diagram" feature?
My first idea would be to produce data (resulting a project files analysis) that is compatible with the existing diagrams feature because it's dependancies graph just like the one using "diagram/show diagram" button.
Many thanks
Please sign in to leave a comment.
User invokable commands are implemented using Actions (https://plugins.jetbrains.com/docs/intellij/basic-action-system.html). Those could be presented e.g. in context menu of Project View toolwindow or any other relevant place(s).
You can find sample code for re-using diagrams feature here:
org.angularjs.diagram.AngularUiRouterDiagramProvider in AngularJS plugin: https://github.com/JetBrains/intellij-plugins/tree/master/AngularJS
com.intellij.lang.javascript.uml.FlashUmlProvider in Flex support https://github.com/JetBrains/intellij-plugins/tree/master/flex
and in 3rd party plugins: https://plugins.jetbrains.com/intellij-platform-explorer?extensions=com.intellij.diagram.Provider
You can then use all same features as you can see in bundled diagram functionality from IntelliJ/plugins.
> Can I code a plugin in javascript?
No, only JVM Languages can be used (https://plugins.jetbrains.com/docs/intellij/intellij-platform.html#plugins)
Thank you very much