Say hello to Graph Buddy!
Your new best pal to help you understand your Java and Scala code better
With today's IDEs, we are all forced to browse code written as text in flatly-structured files, with almost no information about the semantic dependencies between particular code units. What if we could take a different look and, instead of seeing just source code in text files, go through colorful graph nodes that instantly and clearly show you the structure of your code extracted from your codebase?
How can Graph Buddy help you?
Graph Buddy aims to speed up your process of reading and learning your source code. The Graph Buddy plugin provides a set of useful features and techniques that will help you easily browse through twisted code dependencies. At the same time, it gives you a better understanding of the code structure in your codebase.
Table of Contents
Graph Buddy is still under development and currently only supports:
Configuration for Java projects
Java is supported out-of-the-box, no extra configuration is necessary. You just need to install our plugin and it will automatically generate graph files for the currently open project on startup. The initial graph generation may take a few minutes for larger projects. If you change something in the code, the plugin will update the graph automatically. However, some changes (like changing the branch, removing multiple files at once) might not be propagated correctly. If you notice that the plugin isn't working correctly (for example, if some nodes or edges aren't pointing to the right locations or aren't present at all), you can consider regenerating the graph files. To do so, please click the
Configuration for Scala projects
Here, except for installing the plugin in IDE, you need to configure your scala compiler. GraphBuddy has a plugin to it, which will generate graph files during compilation.
For sbt you can use sbt plugin. Just create plugin file
or add scalac compiler plugin directly:
Please remember to recompile the project with a new scalac plugin. In sbt:
Graph Buddy currently supports the following scala versions:
Installing a plugin
Make sure you have the following installed:
The plugin is available for:
You can install the plugin directly in your IDE - simply navigate to the store inside your IDE and
How to use Graph Buddy
Graph Buddy plugin adds a unique view into your IDE. You can perform visual operations, both by clicking on your code or on the graph visualization. Doing so will modify the graph structure accordingly, showcasing semantics info about your project.
Opening the Graph Buddy board
Indexing the graph
The graph will be reindexed automatically during the project startup if there are any graph files in the
To reindex graph manually click the desired reindex option in the activity bar (left).
Graph Buddy features
NOTE: The plugin is optimised for working in the default, 2D mode. Some features may not correctly (or even at all) in 3D mode.
Adding nodes to the graph
You can do this in multiple ways. The most intuitive is clicking on the code - then the corresponding node should appear on plugin canvas.
The second way is using options from the context menu in the editor or on canvas. In the editor, there are some options to generate the whole graph for a selected place in the code.
You can check where a given node is called using node context actions Called by & Call hierarchy. You can also find paths between nodes already added to the graph.
Filters, layouts, search
You can filter elements of a particular type using the menu on the top of the Graph Buddy panel. Layouts can help you organize nodes on the canvas. Finally, using search you can highlight elements matching the search phrase on the canvas. You can search by a part of the node name or by node type (i.e.
If you want to preserve the current graph state for later use (i.e. to present it to your colleague), you can do this by clicking on the floppy disk icon on the toolbar. There you can save a snapshot of your current work or load a previously saved snapshot. You can find those snapshots in the
Graph files regeneration and reindexing
If you are working with a Java project, then under some circumstances (switching branches, applying a code patch, editing or removing multiple files at once) some graph files may become outdated and as a result, the plugin may not work as expected (nodes and edges may be missing from the graph or pointing to incorrect locations in the code). There currently is no automated detection for these cases. When in doubt, you should trigger the
We are happy to get constructive feedback that could improve this project! If you want to help/ask
questions, feel free to contact us: