Skip to content

Commit 313e011

Browse files
committed
First Commit
- Added code for the extension - README updated - cosmetic changes still required
0 parents  commit 313e011

File tree

7 files changed

+997
-0
lines changed

7 files changed

+997
-0
lines changed

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Dependency directories
2+
node_modules/
3+
4+
# Build output
5+
out/
6+
dist/
7+
8+
# VS Code specific files
9+
.vscode-test/
10+
11+
# macOS specific files
12+
.DS_Store
13+
14+
# Extension packaged files
15+
*.vsix
16+
17+
# Logs
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*
21+
22+
# TypeScript cache
23+
*.tsbuildinfo
24+
25+
# Optional npm cache directory
26+
.npm
27+
28+
# Optional eslint cache
29+
.eslintcache
30+
31+
# Exclude test.js files in src directory
32+
src/**/*.test.js
33+
34+
# Include any other patterns you want to ignore

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Change Log
2+
3+
All notable changes to the "Code Visualizer" extension will be documented in this file.
4+
5+
## [Unreleased]
6+
7+
## [0.0.3] - YYYY-MM-DD
8+
### Added
9+
- Visualize command
10+
11+
### Changed
12+
- Changed command name from Generate CodeFlow to Visualize
13+
- Improvement to existing feature
14+
15+
16+
### Moved repo
17+
- Moved repo to Ganjai-Labs
18+
19+
20+
## [0.0.2] - Previous release date
21+
- Generate CodeFlow command
22+

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Code Visualizer 🖥️🔍
2+
3+
## Introduction 👨‍🏫
4+
5+
Thanks for checking out Code Visualizer! 🎉 This extension helps developers visualize their code by generating flowcharts that represent the call hierarchy of functions and methods in your codebase. It transforms the often complex structure of code into an easy-to-understand visual format, making it simpler to navigate large projects. 🗺️
6+
7+
## Features 🌟
8+
- **Flowchart Generation:** 📊 Right-click on any function or method, and select 'Generate Flowchart' to create a visual representation of its call hierarchy.
9+
- **Interactive Visuals:** 🖱️ Zoom in, zoom out, and interact with the flowchart to explore different parts of your code.
10+
- **Customizable Views:** 🎨 Tailor the flowchart to focus on specific function calls, and adjust the layout for better readability.
11+
- **Multi-Language Support:** 🌐 Currently supports C, C++, Python.
12+
* At least that's the goal of the project. Contributions are welcome! 🤝
13+
14+
## How It Works 🛠️
15+
16+
1. Select a function in your code ✅
17+
2. Run the "Visualize" command 🏃‍♂️
18+
3. Watch as CodeFlow creates an interactive diagram of function calls 🎭
19+
4. Click on nodes to explore deeper into the call hierarchy 🕵️‍♂️
20+
21+
CodeFlow uses VS Code's built-in call hierarchy API, making it language-agnostic and powerful across various programming languages. 💪
22+
23+
## Features 🚀
24+
25+
- **Interactive node-based diagrams** 🕸️
26+
- **Direct navigation to function definitions** 🔗
27+
- **Multiple connection visualization for repeated function calls** 🔄
28+
29+
## How to Contribute 🤝
30+
31+
We're excited to welcome contributors to the CodeFlow project! Here's how you can get involved:
32+
33+
1. Fork the repository 🍴
34+
2. Clone your fork: `https://github.com/Ganjai-Labs/code-visualizer.git` 📥
35+
3. Create a new branch: `git checkout -b your-feature-name` 🌿
36+
4. Make your changes ✏️
37+
5. Run tests: `npm test` 🧪
38+
6. Commit your changes: `git commit -m "Add some feature"` 💾
39+
7. Push to the branch: `git push origin your-feature-name` 🚀
40+
8. Submit a pull request 🙏
41+
42+
Before contributing, please read our [Contributing Guidelines](CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md). 📚
43+
44+
## Features to be Implemented 🔮
45+
46+
We're always looking to improve CodeFlow. Here are some features we'd love to see:
47+
48+
1. Detect cycles in the generated diagrams, and highlight them in red 🔴
49+
2. Conditional highlighting of nodes based on certain conditions 🎨
50+
3. Export diagrams as images or SVGs 📸
51+
4. Integration with version control to show changes in call hierarchy over time 🕰️
52+
5. Performance optimizations for large codebases ⚡
53+
6. Enhanced filtering options for complex diagrams 🔍
54+
55+
Feel free to tackle any of these or propose your own ideas! 💡
56+
57+
## Get Started 🚀
58+
59+
Ready to dive in? Install CodeFlow from the VS Code Marketplace and start visualizing your code today! 🎊
60+
61+
Join us in making code comprehension a joyful experience. Happy coding! 😊👨‍💻👩‍💻
62+

package.json

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
"name": "code-visualizer",
3+
"displayName": "Code Visualizer",
4+
"description": "Visualize code structure and call hierarchy",
5+
"version": "0.0.3",
6+
"publisher": "SirilGanjai",
7+
"engines": {
8+
"vscode": "^1.60.0"
9+
},
10+
"categories": [
11+
"Visualization"
12+
],
13+
"activationEvents": [
14+
"onCommand:codeflow.generateCodeFlow"
15+
],
16+
"main": "./out/extension.js",
17+
"contributes": {
18+
"commands": [
19+
{
20+
"command": "codeflow.generateCodeFlow",
21+
"title": "Generate CodeFlow"
22+
},
23+
{
24+
"command": "codeflow.visualize",
25+
"title": "Visualize"
26+
},
27+
{
28+
"command": "codeflow.goToDefinition",
29+
"title": "Go to Definition"
30+
}
31+
],
32+
"menus": {
33+
"editor/context": [
34+
{
35+
"when": "editorTextFocus",
36+
"command": "codeflow.visualize",
37+
"group": "navigation"
38+
}
39+
],
40+
"view/item/context": [
41+
{
42+
"command": "codeflow.visualize",
43+
"when": "view == functionExplorer",
44+
"group": "inline"
45+
},
46+
{
47+
"command": "codeflow.goToDefinition",
48+
"when": "view == functionExplorer",
49+
"group": "inline"
50+
}
51+
]
52+
},
53+
"views": {
54+
"explorer": [
55+
{
56+
"id": "functionExplorer",
57+
"name": "Function Explorer"
58+
}
59+
]
60+
}
61+
},
62+
"scripts": {
63+
"vscode:prepublish": "npm run compile",
64+
"compile": "tsc -p ./",
65+
"watch": "tsc -watch -p ./",
66+
"pretest": "npm run compile && npm run lint",
67+
"lint": "eslint src --ext ts",
68+
"test": "node ./out/test/runTest.js"
69+
},
70+
"devDependencies": {
71+
"@types/mocha": "^10.0.8",
72+
"@types/node": "^14.14.37",
73+
"@types/vscode": "^1.60.0",
74+
"@typescript-eslint/eslint-plugin": "^4.22.0",
75+
"@typescript-eslint/parser": "^4.22.0",
76+
"eslint": "^7.25.0",
77+
"typescript": "^4.2.4"
78+
},
79+
"dependencies": {
80+
"@braintree/sanitize-url": "^7.1.0",
81+
"d3-color": "^3.1.0",
82+
"dompurify": "^3.1.6",
83+
"mermaid": "^11.3.0"
84+
},
85+
"repository": {
86+
"type": "git",
87+
"url": "https://github.com/Ganjai-Labs/code-visualizer.git"
88+
}
89+
}

0 commit comments

Comments
 (0)