From f483121681156777d0702bd681deb5ed12b8a291 Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Sun, 1 Dec 2024 21:43:27 +0200 Subject: [PATCH 01/15] Try and position the view on the sidebar --- package.json | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 36a3950..8ec18bf 100644 --- a/package.json +++ b/package.json @@ -122,6 +122,22 @@ } } }, + "viewsContainers": { + "panel": [ + { + "id": "functionGraphOverview.overview", + "title": "Graph Overview", + "icon": "./media/svg/view-icon.svg" + } + ], + "activitybar": [ + { + "id": "functionGraphOverview.overview", + "title": "Graph Overview", + "icon": "./media/svg/view-icon.svg" + } + ] + }, "views": { "explorer": [ { @@ -138,4 +154,4 @@ "engines": { "vscode": "^1.86.0" } -} +} \ No newline at end of file From 9105ee8934df0dc7deeca56635cd717954e837c3 Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Sun, 1 Dec 2024 21:44:48 +0200 Subject: [PATCH 02/15] lint --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8ec18bf..8aedea2 100644 --- a/package.json +++ b/package.json @@ -154,4 +154,4 @@ "engines": { "vscode": "^1.86.0" } -} \ No newline at end of file +} From 5fc3cff30a06aeb3d0fb6a9dfbbe9c6ac30db733 Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Sun, 1 Dec 2024 21:48:04 +0200 Subject: [PATCH 03/15] IDs need to match a regex --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8aedea2..5352798 100644 --- a/package.json +++ b/package.json @@ -125,14 +125,14 @@ "viewsContainers": { "panel": [ { - "id": "functionGraphOverview.overview", + "id": "functionGraphOverview-overview", "title": "Graph Overview", "icon": "./media/svg/view-icon.svg" } ], "activitybar": [ { - "id": "functionGraphOverview.overview", + "id": "functionGraphOverview-overview", "title": "Graph Overview", "icon": "./media/svg/view-icon.svg" } @@ -142,7 +142,7 @@ "explorer": [ { "type": "webview", - "id": "functionGraphOverview.overview", + "id": "functionGraphOverview-overview", "name": "Graph Overview", "icon": "./media/svg/view-icon.svg", "contextualTitle": "Graph Overview", From bac1e0654d2fa498117cc4044327e4238e1c4c24 Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Sun, 1 Dec 2024 21:50:51 +0200 Subject: [PATCH 04/15] I'll get it eventually --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 5352798..dc62b57 100644 --- a/package.json +++ b/package.json @@ -125,14 +125,14 @@ "viewsContainers": { "panel": [ { - "id": "functionGraphOverview-overview", + "id": "explorer", "title": "Graph Overview", "icon": "./media/svg/view-icon.svg" } ], "activitybar": [ { - "id": "functionGraphOverview-overview", + "id": "explorer", "title": "Graph Overview", "icon": "./media/svg/view-icon.svg" } @@ -142,7 +142,7 @@ "explorer": [ { "type": "webview", - "id": "functionGraphOverview-overview", + "id": "functionGraphOverview.overview", "name": "Graph Overview", "icon": "./media/svg/view-icon.svg", "contextualTitle": "Graph Overview", @@ -154,4 +154,4 @@ "engines": { "vscode": "^1.86.0" } -} +} \ No newline at end of file From e8d5a8edbc093465ca39883787116e2bdd7fc1b4 Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Sun, 1 Dec 2024 21:53:48 +0200 Subject: [PATCH 05/15] Now? --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dc62b57..b24b659 100644 --- a/package.json +++ b/package.json @@ -154,4 +154,4 @@ "engines": { "vscode": "^1.86.0" } -} \ No newline at end of file +} From 51e7764ce77f4c0abe776377c7f04f481da31cd0 Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Sun, 1 Dec 2024 21:58:54 +0200 Subject: [PATCH 06/15] Grrr --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b24b659..19ebfef 100644 --- a/package.json +++ b/package.json @@ -125,21 +125,21 @@ "viewsContainers": { "panel": [ { - "id": "explorer", + "id": "function-graph-overview-panel", "title": "Graph Overview", "icon": "./media/svg/view-icon.svg" } ], "activitybar": [ { - "id": "explorer", + "id": "function-graph-overview-activitybar", "title": "Graph Overview", "icon": "./media/svg/view-icon.svg" } ] }, "views": { - "explorer": [ + "function-graph-overview-activitybar": [ { "type": "webview", "id": "functionGraphOverview.overview", @@ -154,4 +154,4 @@ "engines": { "vscode": "^1.86.0" } -} +} \ No newline at end of file From dbb9308f4ecc297d0c8529635fa07e9ae4db6055 Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Sun, 1 Dec 2024 21:59:39 +0200 Subject: [PATCH 07/15] lint --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 19ebfef..a589bdb 100644 --- a/package.json +++ b/package.json @@ -154,4 +154,4 @@ "engines": { "vscode": "^1.86.0" } -} \ No newline at end of file +} From 56e99024ca05a03435cb4618dd843414631d3549 Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Sun, 1 Dec 2024 22:44:10 +0200 Subject: [PATCH 08/15] Updated docs to make getting-started easier --- .vscode/launch.json | 11 ++++++++--- README.md | 35 +++++++++++------------------------ docs/Development.md | 27 +++++++++++++++++++++++++++ package.json | 26 +++++++++++++------------- src/vscode/extension.ts | 11 ++++++++++- 5 files changed, 69 insertions(+), 41 deletions(-) create mode 100644 docs/Development.md diff --git a/.vscode/launch.json b/.vscode/launch.json index ccdb134..114d5b7 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,9 +9,14 @@ "name": "Run Extension", "type": "extensionHost", "request": "launch", - "args": ["--extensionDevelopmentPath=${workspaceFolder}"], - "outFiles": ["${workspaceFolder}/dist/**/*.js"], + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}", + "--profile=B2" + ], + "outFiles": [ + "${workspaceFolder}/dist/**/*.js" + ], "preLaunchTask": "${defaultBuildTask}" } ] -} +} \ No newline at end of file diff --git a/README.md b/README.md index 5435a89..1ca3805 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,18 @@ This extension adds a Graph Overview to VS Code, showing the CFG (control-flow g ![Screenshot of the extension](./media/screenshots/banner_dark.png) -## Installation +## Getting Started -Install via the [extension page](https://marketplace.visualstudio.com/items?itemName=tamir-bahar.function-graph-overview) at the VSCode Marketplace. +1. Install via the [extension page](https://marketplace.visualstudio.com/items?itemName=tamir-bahar.function-graph-overview) at the VSCode Marketplace. + +2. Open the command-pallete (Ctrl+Shift+P or ⇧⌘P) and run the `Function Graph Overview: Show Graph Overview` command. + +3. Open your code and place your cursor inside a function to see the graph. + +## JetBrains IDEs + +If you're using a JetBrains IDEs, see [the JetBrains plugin](https://github.com/tmr232/jb-function-graph-overview) +for further instructions. ## Demo @@ -47,25 +56,3 @@ Custom color schems are created via the [interactive demo](https://tmr232.github - [C](https://tmr232.github.io/function-graph-overview/?language=1) - [C++](https://tmr232.github.io/function-graph-overview/?language=3) - [Python](https://tmr232.github.io/function-graph-overview/?language=2) - -## Development - -### Requirements - -- [Bun](https://bun.sh/) is required to develop the project. -- [Bun for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=oven.bun-vscode) is needed for debugging in VS Code -- [emscripted](https://emscripten.org/) is only required if you want to add new tree-sitter parsers. - -### Getting Started - -Clone the project and install dependencies. - -```bash -git clone https://github.com/tmr232/function-graph-overview/ -cd function-graph-overview -bun install -``` - -You can debug the extension via VS Code by pressing F5. - -To run the demo, run `bun demo`. diff --git a/docs/Development.md b/docs/Development.md new file mode 100644 index 0000000..3ad536d --- /dev/null +++ b/docs/Development.md @@ -0,0 +1,27 @@ +# Development + +These are instructions for developing this project. +For usage instructions, return to [the readme](../README.md). + +## Minimal Requirements + +- [Bun](https://bun.sh/) is required to develop the project. +- [Bun for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=oven.bun-vscode) is needed for debugging in VS Code + +## Getting Started + +Clone the project and install dependencies. + +```bash +git clone https://github.com/tmr232/function-graph-overview/ +cd function-graph-overview +bun install +``` + +You can debug the extension via VS Code by pressing F5. + +To run the demo, run `bun demo`. + +## Adding Languages + +If you want to add support for more languages, read about [adding a language](./AddNewLanguage.md). diff --git a/package.json b/package.json index a589bdb..1cc5541 100644 --- a/package.json +++ b/package.json @@ -123,35 +123,35 @@ } }, "viewsContainers": { - "panel": [ - { - "id": "function-graph-overview-panel", - "title": "Graph Overview", - "icon": "./media/svg/view-icon.svg" - } - ], "activitybar": [ { - "id": "function-graph-overview-activitybar", - "title": "Graph Overview", + "id": "function-graph-overview", + "title": "Function Graph Overview", "icon": "./media/svg/view-icon.svg" } ] }, "views": { - "function-graph-overview-activitybar": [ + "function-graph-overview": [ { "type": "webview", "id": "functionGraphOverview.overview", - "name": "Graph Overview", + "name": "Function Graph Overview", "icon": "./media/svg/view-icon.svg", "contextualTitle": "Graph Overview", "visibility": "visible" } ] - } + }, + "commands": [ + { + "command": "functionGraphOverview.focus", + "title": "Show Graph Overview", + "category": "Function Graph Overview" + } + ] }, "engines": { "vscode": "^1.86.0" } -} +} \ No newline at end of file diff --git a/src/vscode/extension.ts b/src/vscode/extension.ts index 295492b..3bdc0a0 100644 --- a/src/vscode/extension.ts +++ b/src/vscode/extension.ts @@ -387,9 +387,18 @@ export async function activate(context: vscode.ExtensionContext) { }, ), ); + + + const command = 'functionGraphOverview.focus'; + + const commandHandler = () => { + vscode.commands.executeCommand("functionGraphOverview.overview.focus") + }; + + context.subscriptions.push(vscode.commands.registerCommand(command, commandHandler)); } // This method is called when your extension is deactivated -export function deactivate() {} +export function deactivate() { } //------------------------------------------------ From e7564eca3c620d3e3fd8f4a3904ad07c02b91254 Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Sun, 1 Dec 2024 22:46:08 +0200 Subject: [PATCH 09/15] lint --- .vscode/launch.json | 11 +++-------- README.md | 6 +++--- package.json | 2 +- src/vscode/extension.ts | 11 ++++++----- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 114d5b7..4eba4de 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,14 +9,9 @@ "name": "Run Extension", "type": "extensionHost", "request": "launch", - "args": [ - "--extensionDevelopmentPath=${workspaceFolder}", - "--profile=B2" - ], - "outFiles": [ - "${workspaceFolder}/dist/**/*.js" - ], + "args": ["--extensionDevelopmentPath=${workspaceFolder}", "--profile=B2"], + "outFiles": ["${workspaceFolder}/dist/**/*.js"], "preLaunchTask": "${defaultBuildTask}" } ] -} \ No newline at end of file +} diff --git a/README.md b/README.md index 1ca3805..4f05bd0 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,12 @@ This extension adds a Graph Overview to VS Code, showing the CFG (control-flow g 3. Open your code and place your cursor inside a function to see the graph. -## JetBrains IDEs +### JetBrains IDEs -If you're using a JetBrains IDEs, see [the JetBrains plugin](https://github.com/tmr232/jb-function-graph-overview) +If you're using a JetBrains IDE, see [the JetBrains plugin](https://github.com/tmr232/jb-function-graph-overview) for further instructions. -## Demo +### Demo You can try it out via an [interactive demo](https://tmr232.github.io/function-graph-overview/) if you don't want to install it. diff --git a/package.json b/package.json index 1cc5541..5a2471a 100644 --- a/package.json +++ b/package.json @@ -154,4 +154,4 @@ "engines": { "vscode": "^1.86.0" } -} \ No newline at end of file +} diff --git a/src/vscode/extension.ts b/src/vscode/extension.ts index 3bdc0a0..89d960e 100644 --- a/src/vscode/extension.ts +++ b/src/vscode/extension.ts @@ -388,17 +388,18 @@ export async function activate(context: vscode.ExtensionContext) { ), ); - - const command = 'functionGraphOverview.focus'; + const command = "functionGraphOverview.focus"; const commandHandler = () => { - vscode.commands.executeCommand("functionGraphOverview.overview.focus") + vscode.commands.executeCommand("functionGraphOverview.overview.focus"); }; - context.subscriptions.push(vscode.commands.registerCommand(command, commandHandler)); + context.subscriptions.push( + vscode.commands.registerCommand(command, commandHandler), + ); } // This method is called when your extension is deactivated -export function deactivate() { } +export function deactivate() {} //------------------------------------------------ From f53dbead06f2e5921bfc338f817adc233a312ef3 Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Sun, 1 Dec 2024 22:49:20 +0200 Subject: [PATCH 10/15] Updated changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bd2f9d..74f5059 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,15 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ## [Unreleased] +### Added + +- Added the `Function Graph Overview: Show Graph Overview` command to VSCode to show the graph + +### Changed + +- In VSCode, the extension will now show in the activity bar by default +- All development-related docs moved to the `docs` directory to avoid confusing users + ## [0.0.10] ### Added From 7cef2e6802b73d0b5c25a8f2afae8b7bc7de9e27 Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Sun, 1 Dec 2024 22:54:50 +0200 Subject: [PATCH 11/15] More docs! --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4f05bd0..de826de 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ This extension adds a Graph Overview to VS Code, showing the CFG (control-flow g 3. Open your code and place your cursor inside a function to see the graph. +4. You can drag the graph view to the other sidebar or to the bottom panel + ### JetBrains IDEs If you're using a JetBrains IDE, see [the JetBrains plugin](https://github.com/tmr232/jb-function-graph-overview) From f95000266c95b352cf976456ab8082fa550e1817 Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Sun, 1 Dec 2024 22:55:16 +0200 Subject: [PATCH 12/15] Bump version --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5a2471a..61ccc27 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "//": "START EXTENSION ATTRIBUTES", "publisher": "tamir-bahar", "name": "function-graph-overview", - "version": "0.0.10", + "version": "0.0.11", "description": "Function Graph Overview", "displayName": "Function Graph Overview", "icon": "./media/icon.png", @@ -154,4 +154,4 @@ "engines": { "vscode": "^1.86.0" } -} +} \ No newline at end of file From 194050947a58387d1ad787d9e6728f447e0da787 Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Sun, 1 Dec 2024 22:56:10 +0200 Subject: [PATCH 13/15] Formatting... --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 61ccc27..8404a68 100644 --- a/package.json +++ b/package.json @@ -154,4 +154,4 @@ "engines": { "vscode": "^1.86.0" } -} \ No newline at end of file +} From 069bb6906e9a5163b4104d488e4b26f8df50ff2e Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Sun, 1 Dec 2024 22:57:47 +0200 Subject: [PATCH 14/15] Remove custom profile from launch config --- .vscode/launch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 4eba4de..ccdb134 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,7 +9,7 @@ "name": "Run Extension", "type": "extensionHost", "request": "launch", - "args": ["--extensionDevelopmentPath=${workspaceFolder}", "--profile=B2"], + "args": ["--extensionDevelopmentPath=${workspaceFolder}"], "outFiles": ["${workspaceFolder}/dist/**/*.js"], "preLaunchTask": "${defaultBuildTask}" } From 3fcfb4cbc1f1b7aa544c9d283111112218083097 Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Sun, 1 Dec 2024 23:00:58 +0200 Subject: [PATCH 15/15] Updated changelong --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74f5059..a9fa638 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ## [Unreleased] +## [0.0.11] + ### Added - Added the `Function Graph Overview: Show Graph Overview` command to VSCode to show the graph