https://github.com/dmitrii-artuhov/symbols-counter-intellij-plugin
Intellij IDEA plugin that counts the number of classes and methods in Java projects.
https://github.com/dmitrii-artuhov/symbols-counter-intellij-plugin
Last synced: 3 months ago
JSON representation
Intellij IDEA plugin that counts the number of classes and methods in Java projects.
- Host: GitHub
- URL: https://github.com/dmitrii-artuhov/symbols-counter-intellij-plugin
- Owner: dmitrii-artuhov
- Created: 2023-09-30T20:01:12.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-04T21:38:43.000Z (about 2 years ago)
- Last Synced: 2025-03-13T18:23:57.246Z (7 months ago)
- Language: Java
- Size: 140 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Symbols Counter Plugin
## Functionality:
- Plugin add a custom tool window to the IDEA ui. It is located in the bottom right corner with title "Project Symbols".
- Plugin scans the source code and outputs tree-like structure of the Java files in the project with all classes and methods in those files.
- Plugin tracks changes via listening to the virtual filesystem, meaning:
- Deleting and creating files will automatically update the tool window content.
- Editing existing file will be propagated upon explicit saving of file: Ctrl/Cmd + S shortcut.For the project on the 1st picture plugin will generate an output as shown on the 2nd one. Blue icon shows the number of classes per file, the red one — the number of methods per file/class.
![]()
![]()
## Implementation details:
- The plugin uses MVC structure:
- **Model**: [JavaSymbolsProvider](./src/main/java/symbolscounterplugin/model/JavaSymbolsProvider.java) (retrieves java files and their symbols via visiting PSI elements).
- **View**: [ProjectSymbolsToolWindowFactory](./src/main/java/symbolscounterplugin/ui/ProjectSymbolsToolWindowFactory.java) (contains the tool window), [SymbolsTreeCellRenderer](./src/main/java/symbolscounterplugin/ui/tree/SymbolsTreeCellRenderer.java) (contains the rendering logic for the tree-like structure that shows project symbols).
- **Controller**: [SymbolsToolWindowController](./src/main/java/symbolscounterplugin/controller/SymbolsToolWindowController.java) (manages updating of the tree, creates tree nodes and tree representation in memory, updates the ui after the tree was recalculated).## Building and running:
- Project uses gradle, so it should be enough to open it in Intellij IDEA, and it will automatically setup everything.
- In order to run an IDEA instance with the plugin integrated in it, run `gradle runIde`.
- To run tests use `gradle test`.