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.
Graph Buddy is still under development and currently only supports:
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 Generate Java graph
action from the Graph Buddy
menu.
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 project/graphbuddy.sbt
with the content:
addSbtPlugin("org.virtuslab.semanticgraphs" % "sbt-plugin" % "0.2.20")
or add scalac compiler plugin directly:
addCompilerPlugin("org.virtuslab.semanticgraphs" % "scalac-plugin" % "0.2.20" cross CrossVersion.full) scalacOptions += "-Yrangepos"
Please remember to recompile the project with a new scalac plugin. In sbt:
Graph Buddy currently supports the following scala versions:
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 search for 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 boardLook for a 'Graph Buddy' tab in the bottom right corner and press it.
Click the Graph Buddy
icon in the activity bar (left), then press the Open Graph Buddy window
button. It will open the Graph Buddy board; just wait for the reindexing process to finish and start browsing!
The graph will be reindexed automatically during the project startup if there are any graph files in the .semanticgraphs
folder.
To reindex graph manually:
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 graphYou 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.
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. CLASS
).
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 .graphbuddy
folder.
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 Generate graph
action from the Main Menu to make sure you are working with up-to-date graph files. If you are working with a Scala project, assuming you have configured the compiler plugin correctly, you should manually trigger the Reindex graph
action from the Main Menu. This will load the newly generated graph files to the plugin.
We are happy to get constructive feedback that could improve this project! If you want to help/ask questions, feel free to contact us: graphbuddy@virtuslab.com
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4