Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions mpp-vscode/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# VSCode extension ignore file
# Exclude source files and build artifacts not needed in the packaged extension

# Source files
src/
webview/src/
webview/node_modules/

# Build artifacts
*.map
tsconfig.json
.eslintrc.json

# Development files
.vscode/
node_modules/
.gitignore
.git/

# Test files
**/__tests__/**
**/*.test.*
**/*.spec.*

# Documentation
README.md
CHANGELOG.md

# Keep dist and wasm folders
!dist/
!wasm/

73 changes: 71 additions & 2 deletions mpp-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,34 @@
{
"command": "autodev.runAgent",
"title": "AutoDev: Run Coding Agent"
},
{
"command": "autodev.codelens.quickChat",
"title": "AutoDev: Quick Chat"
},
{
"command": "autodev.codelens.explainCode",
"title": "AutoDev: Explain Code"
},
{
"command": "autodev.codelens.optimizeCode",
"title": "AutoDev: Optimize Code"
},
{
"command": "autodev.codelens.autoComment",
"title": "AutoDev: Auto Comment"
},
{
"command": "autodev.codelens.autoTest",
"title": "AutoDev: Auto Test"
},
{
"command": "autodev.codelens.autoMethod",
"title": "AutoDev: Auto Method"
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The command autodev.codelens.showMenu is registered in codelens-commands.ts and used in codelens-provider.ts (line 198), but it's not declared in the commands section of package.json. While VS Code allows undeclared commands for internal use, it's better practice to declare all commands for discoverability and consistency.

Add the command declaration:

{
  "command": "autodev.codelens.showMenu",
  "title": "AutoDev: Show CodeLens Menu"
}
Suggested change
"title": "AutoDev: Auto Method"
"title": "AutoDev: Auto Method"
},
{
"command": "autodev.codelens.showMenu",
"title": "AutoDev: Show CodeLens Menu"

Copilot uses AI. Check for mistakes.
},
{
"command": "autodev.codelens.showMenu",
"title": "AutoDev: Show CodeLens Menu"
}
],
"viewsContainers": {
Expand Down Expand Up @@ -99,6 +127,44 @@
"type": "number",
"default": 23120,
"description": "Port for the IDE server (MCP protocol)"
},
"autodev.codelens.enable": {
"type": "boolean",
"default": true,
"description": "Enable CodeLens to show AI actions above functions and classes"
},
"autodev.codelens.displayMode": {
"type": "string",
"default": "expand",
"enum": [
"expand",
"collapse"
],
"enumDescriptions": [
"Show all actions separately",
"Show a collapsed menu"
],
"description": "CodeLens display mode"
},
"autodev.codelens.items": {
"type": "array",
"default": [
"quickChat",
"autoTest",
"autoComment"
],
"items": {
"type": "string",
"enum": [
"quickChat",
"explainCode",
"optimizeCode",
"autoComment",
"autoTest",
"autoMethod"
]
},
"description": "CodeLens items to display"
}
}
},
Expand Down Expand Up @@ -137,9 +203,10 @@
},
"scripts": {
"vscode:prepublish": "npm run build",
"build": "npm run build:extension && npm run build:webview",
"build:extension": "esbuild ./src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --external:ws --format=cjs --platform=node",
"build": "npm run build:extension && npm run build:webview && npm run copy:wasm",
"build:extension": "esbuild ./src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --external:ws --external:web-tree-sitter --format=cjs --platform=node",
"build:webview": "cd webview && npm install && npm run build",
"copy:wasm": "node scripts/copy-wasm.js",
"watch": "npm run build:extension -- --watch",
"package": "vsce package",
"lint": "eslint src --ext ts",
Expand All @@ -162,8 +229,10 @@
"dependencies": {
"@autodev/mpp-core": "file:../mpp-core/build/packages/js",
"@modelcontextprotocol/sdk": "^1.0.0",
"@unit-mesh/treesitter-artifacts": "^1.7.7",
"cors": "^2.8.5",
"express": "^4.18.2",
"web-tree-sitter": "^0.25.10",
Comment on lines +258 to +261
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The web-tree-sitter package requires WASM files to be loaded at runtime. The WASM path resolution in code-element-parser.ts uses require.resolve() which may not work correctly in a bundled extension environment.

Consider:

  1. Ensuring WASM files from @unit-mesh/treesitter-artifacts are copied to the dist folder during build
  2. Using vscode.Uri.joinPath(context.extensionUri, 'wasm', ...) for path resolution instead of require.resolve()
  3. Testing the CodeLens feature in a packaged extension to verify WASM loading works correctly

Copilot uses AI. Check for mistakes.
"yaml": "^2.8.2",
"zod": "^3.22.4"
}
Expand Down
49 changes: 49 additions & 0 deletions mpp-vscode/scripts/copy-wasm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env node
/**
* Copy WASM files from @unit-mesh/treesitter-artifacts to dist/wasm
*/

const fs = require('fs');
const path = require('path');

const sourceDir = path.join(__dirname, '../node_modules/@unit-mesh/treesitter-artifacts/wasm');
const targetDir = path.join(__dirname, '../dist/wasm');

// Create target directory if it doesn't exist
if (!fs.existsSync(targetDir)) {
fs.mkdirSync(targetDir, { recursive: true });
}

// List of required WASM files
const wasmFiles = [
'tree-sitter-typescript.wasm',
'tree-sitter-tsx.wasm',
'tree-sitter-javascript.wasm',
'tree-sitter-python.wasm',
'tree-sitter-java.wasm',
'tree-sitter-kotlin.wasm',
'tree-sitter-go.wasm',
'tree-sitter-rust.wasm'
];

// Copy each WASM file
let copiedCount = 0;
for (const file of wasmFiles) {
const sourcePath = path.join(sourceDir, file);
const targetPath = path.join(targetDir, file);

try {
if (fs.existsSync(sourcePath)) {
fs.copyFileSync(sourcePath, targetPath);
console.log(`✓ Copied ${file}`);
copiedCount++;
} else {
console.warn(`⚠ Warning: ${file} not found in source directory`);
}
} catch (error) {
console.error(`✗ Failed to copy ${file}: ${error.message}`);
}
}

console.log(`\nCopied ${copiedCount}/${wasmFiles.length} WASM files to dist/wasm/`);

Loading
Loading