Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode Getting Started Experience #36

Merged
merged 15 commits into from
Dec 1, 2024
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ 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

### 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
Expand Down
39 changes: 14 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,22 @@ 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.

## Demo
2. Open the command-pallete (<kbd>Ctrl+Shift+P</kbd> or <kbd>⇧⌘P</kbd>) 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.

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)
for further instructions.

### 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.

Expand Down Expand Up @@ -47,25 +58,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`.
27 changes: 27 additions & 0 deletions docs/Development.md
Original file line number Diff line number Diff line change
@@ -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).
24 changes: 20 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -122,18 +122,34 @@
}
}
},
"viewsContainers": {
"activitybar": [
{
"id": "function-graph-overview",
"title": "Function Graph Overview",
"icon": "./media/svg/view-icon.svg"
}
]
},
"views": {
"explorer": [
"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"
Expand Down
10 changes: 10 additions & 0 deletions src/vscode/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,16 @@ 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
Expand Down