Skip to content

Commit 3729144

Browse files
committed
feat: Add ghost text provider, parser service, and teacher slate service for enhanced coding assistance
- Implemented GhostTextProvider for inline code suggestions based on lesson context. - Created ParserService to analyze code and establish relationships between definitions and usages. - Developed TeacherSlateService to manage lesson state, provide feedback, and handle text decorations in the editor. - Introduced VisualizerProvider for displaying code relationships in a webview. - Added initial test suite for extension functionality. - Configured TypeScript and Webpack for building the extension. - Included extension quickstart guide for setup and usage instructions.
0 parents  commit 3729144

22 files changed

Lines changed: 6240 additions & 0 deletions

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
out
2+
dist
3+
node_modules
4+
.vscode-test/
5+
*.vsix

.vscode-test.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig } from '@vscode/test-cli';
2+
3+
export default defineConfig({
4+
files: 'out/test/**/*.test.js',
5+
});

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher", "ms-vscode.extension-test-runner"]
5+
}

.vscode/launch.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// A launch configuration that compiles the extension and then opens it inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Run Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"args": [
13+
"--extensionDevelopmentPath=${workspaceFolder}"
14+
],
15+
"outFiles": [
16+
"${workspaceFolder}/dist/**/*.js"
17+
],
18+
"preLaunchTask": "${defaultBuildTask}"
19+
}
20+
]
21+
}

.vscode/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
"files.exclude": {
4+
"out": false, // set this to true to hide the "out" folder with the compiled JS files
5+
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
6+
},
7+
"search.exclude": {
8+
"out": true, // set this to false to include "out" folder in search results
9+
"dist": true // set this to false to include "dist" folder in search results
10+
},
11+
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
12+
"typescript.tsc.autoDetect": "off"
13+
}

.vscode/tasks.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// See https://go.microsoft.com/fwlink/?LinkId=733558
2+
// for the documentation about the tasks.json format
3+
{
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"type": "npm",
8+
"script": "watch",
9+
"problemMatcher": "$ts-webpack-watch",
10+
"isBackground": true,
11+
"presentation": {
12+
"reveal": "never",
13+
"group": "watchers"
14+
},
15+
"group": {
16+
"kind": "build",
17+
"isDefault": true
18+
}
19+
},
20+
{
21+
"type": "npm",
22+
"script": "watch-tests",
23+
"problemMatcher": "$tsc-watch",
24+
"isBackground": true,
25+
"presentation": {
26+
"reveal": "never",
27+
"group": "watchers"
28+
},
29+
"group": "build"
30+
},
31+
{
32+
"label": "tasks: watch-tests",
33+
"dependsOn": [
34+
"npm: watch",
35+
"npm: watch-tests"
36+
],
37+
"problemMatcher": []
38+
}
39+
]
40+
}

.vscodeignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.vscode/**
2+
.vscode-test/**
3+
out/**
4+
node_modules/**
5+
src/**
6+
.gitignore
7+
.yarnrc
8+
webpack.config.js
9+
vsc-extension-quickstart.md
10+
**/tsconfig.json
11+
**/eslint.config.mjs
12+
**/*.map
13+
**/*.ts
14+
**/.vscode-test.*

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Change Log
2+
3+
All notable changes to the "vertex-vscode" extension will be documented in this file.
4+
5+
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
6+
7+
## [Unreleased]
8+
9+
- Initial release

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# 🌌 Vertex - The Visual Learning Extension for VS Code
2+
3+
**Vertex** is a next-generation educational extension for VS Code that transforms your editor into a mentor. It combines ghost-text guidance, visual call graphs, and motivational AI to help you master coding character-by-character.
4+
5+
## ✨ Key Features
6+
7+
### 🖋️ Teacher's Slate (Learning Mode)
8+
- **Ghost-Text Guidance**: Follow along with predictive ghost text that appears as you type. Learn syntax by doing.
9+
- **Real-time Validation**: Instant feedback on every character. Correct matches stay gray; mismatches are highlighted in red.
10+
- **Zero-Distraction**: Minimalist UI that focuses entirely on the code.
11+
12+
### 🧠 Visual Intelligence
13+
- **Dynamic Call Graph**: A side-by-side view that traces relationships in your code.
14+
- **Living Arrows**: Real-time SVG arrows connect variable usage to definitions and function calls to sources.
15+
- **Cross-Language Support**: Intelligent parsing for **JavaScript/TypeScript, Python, Java, C, and C++**.
16+
17+
### 🧘 Sensei: Motivational AI
18+
- **Gemini Powered**: Uses Google Gemini to provide context-aware, motivational feedback.
19+
- **Non-Intrusive**: Feedback appears in the status bar to keep your workspace clean.
20+
- **Smart Debouncing**: Sensei watches your progress and speaks up when you need a boost.
21+
22+
---
23+
24+
## 🚀 Quick Start
25+
26+
### 1. Prerequisites
27+
- **VS Code**: v1.9x+
28+
- **Gemini API Key**: If not set in your environment (`GEMINI_API_KEY`), Vertex will securely prompt you for it and store it in your VS Code Secret Storage.
29+
30+
### 2. Loading a Lesson
31+
Run the command `Vertex: Load Sample Lesson` from the Command Palette (`Ctrl+Shift+P`).
32+
33+
### 3. Visualizing Relationships
34+
Run the command `Vertex: Show Visual Intelligence` to open the side-by-side visualizer.
35+
36+
---
37+
38+
## ⚙️ Configuration
39+
40+
| Setting | Description | Default |
41+
|---------|-------------|---------|
42+
| `vertex.geminiModel` | Select between `gemini-1.5-flash` or `gemini-1.5-pro` | `gemini-1.5-flash` |
43+
44+
---
45+
46+
## 🤝 Commands
47+
48+
- `Vertex: Load Sample Lesson` – Start a guided coding lesson.
49+
- `Vertex: Clear Lesson` – Clear all decorations and active lessons.
50+
- `Vertex: Show Visual Intelligence` – Toggle the SVG relationship visualizer.
51+
- `Vertex: Reset Gemini API Key` – Clear your stored key to provide a new one.
52+
53+
---
54+
*Built with ❤️ for the next generation of developers.*

eslint.config.mjs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import typescriptEslint from "typescript-eslint";
2+
3+
export default [{
4+
files: ["**/*.ts"],
5+
}, {
6+
plugins: {
7+
"@typescript-eslint": typescriptEslint.plugin,
8+
},
9+
10+
languageOptions: {
11+
parser: typescriptEslint.parser,
12+
ecmaVersion: 2022,
13+
sourceType: "module",
14+
},
15+
16+
rules: {
17+
"@typescript-eslint/naming-convention": ["warn", {
18+
selector: "import",
19+
format: ["camelCase", "PascalCase"],
20+
}],
21+
22+
curly: "warn",
23+
eqeqeq: "warn",
24+
"no-throw-literal": "warn",
25+
semi: "warn",
26+
},
27+
}];

0 commit comments

Comments
 (0)