Skip to content

feat: add vscode support and publish new version#481

Merged
phodal merged 22 commits intophodal:masterfrom
unit-mesh:master
Dec 4, 2025
Merged

feat: add vscode support and publish new version#481
phodal merged 22 commits intophodal:masterfrom
unit-mesh:master

Conversation

@phodal
Copy link
Owner

@phodal phodal commented Dec 4, 2025

Summary by CodeRabbit

  • New Features

    • CodeLens actions for code analysis (explain, optimize), documentation generation, testing, and method completion
    • File change tracking with diff viewer, undo, and keep options
    • Real-time plan state observer displaying execution progress updates
  • Improvements

    • Enhanced tool output visualization in timeline
    • Refined tool naming and rendering behavior

✏️ Tip: You can customize this high-level summary in your review settings.

phodal added 22 commits December 4, 2025 08:59
Introduce new classes for tracking, summarizing, and displaying file changes in the IDEA toolwindow, and update input area to integrate with these features.
Integrate PlanStateService observation to update renderer with current plan. Add logging for plan updates and summary rendering.
Update the plan instance with a new timestamp to ensure StateFlow emits changes when task or step status is updated.
- Add observePlanState method to JsCodingAgent for observing PlanStateService state changes
- Extend JsPlanSummaryData with JsTaskSummary and JsStepSummary for complete task/step info
- Add plan state observer in ChatViewProvider to sync plan updates to webview
- Add planUpdate/planCleared message handling in App.tsx
- Pass currentPlan prop to ChatInput component for PlanSummaryBar display
- Add ws as external dependency in esbuild config
- Add error handling for plan markdown parsing in JewelRenderer
- Restore OutputDisplay in IdeaTerminalRenderer (was commented out)
- Fix root-level files edge case in IdeaFileChangeItem
- Cancel planStateObserverJob in IdeaAgentViewModel.dispose()
- Add dispose() method to ChatViewProvider for cleanup
- Add type guard validation for PlanData in App.tsx
- Replace println with Logger in IdeaFileChangeSummary
- Simplify StateFlow update in PlanStateService (use direct reassignment)
feat(vscode): implement plan functionality for mpp-vscode
Integrate PlanStateService observation to update renderer with current plan. Add logging for plan updates and summary rendering.
- Remove assistant message background for unified look
- Add DevInRenderer to parse and display devin blocks as tool calls
- Filter <devin> tags from markdown content
- Add open file button for read-file tool
- Hide Task completed message (implicit from response)
- Remove unnecessary 'g' flag from regex for unclosed devin tags
- Make standalone </devin> removal more conservative (only on own line)
- Add aria-label attributes for accessibility
- Only show pointer cursor when header is clickable (has params)
- Document limitation: parser does not handle escaped quotes
- Remove redundant trim() call in MarkdownRenderer (filterDevinTags already trims)
- Optimize useMemo in DevInRenderer to skip parsing during streaming
feat(vscode): improve renderer UI for better UX
Remove file path from toolName and use only displayName for clarity.
Use project.basePath for process execution and set terminal output bubble to collapsed by default.
Display tool output in the timeline bubble header, truncating with ellipsis and falling back to params if output is unavailable. UI now handles overflow without fixed truncation.
fix(idea): use correct project basePath for shell execution and improve tool call bubble UI
…ce parsing

## CodeLens Implementation
- Add Tree-sitter based code element parser (code-element-parser.ts)
- Support 7 languages: TypeScript, JavaScript, Python, Java, Kotlin, Go, Rust
- Implement AutoComment, AutoTest, AutoMethod actions
- Add prompt templates for code generation

## CodeFence Fix
- Rewrite codeFence.ts to match mpp-core's CodeFence.parseAll logic
- Add preProcessDevinBlock to convert ```devin blocks to <devin> tags
- Handle <devin>, <thinking>, and <!-- walkthrough_start --> tags
- Fix issue where devin instructions showed extra CodeBlockRenderer

## Other Changes
- Remove auto-add current file feature from ChatInput
- Add getCurrentModelConfig to ChatViewProvider for CodeLens actions
- Add web-tree-sitter and @unit-mesh/treesitter-artifacts dependencies
Eliminates duplicate DevIn rendering, tool rerun button, and timeline item headers for a cleaner UI and improved code structure.
- Add missing autodev.codelens.showMenu command declaration
- Remove unsupported languages (csharp, cpp, c) from CodeLens registration
- Fix Python test file naming to use consistent test_*.py format
- Implement robust WASM file bundling and path resolution
  - Add copy-wasm.js script to copy WASM files during build
  - Update build script to include web-tree-sitter external and copy:wasm
  - Implement multi-strategy path resolution (extension path + node_modules fallback)
  - Add .vscodeignore to ensure WASM files are packaged
Update mppVersion in gradle.properties and add new media assets and backup files for the upcoming release.
feat(mpp-vscode): implement CodeLens with Tree-sitter and fix CodeFence parsing
…iles

- Update .vscodeignore to exclude parent directories
- Add *.vsix to .gitignore to avoid committing large binary files
Copilot AI review requested due to automatic review settings December 4, 2025 12:54
@coderabbitai
Copy link

coderabbitai bot commented Dec 4, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR introduces plan state observability across the platform (CodingAgent and PlanStateService), adds file change tracking and UI components to the IDEA plugin, expands the VSCode extension with CodeLens actions (AutoComment, AutoTest, AutoMethod) backed by tree-sitter code parsing, and updates version to 0.3.4.

Changes

Cohort / File(s) Summary
Version & Dependencies Version bumped from 0.3.3 to 0.3.4 in gradle properties, npm packages, and mpp-core dependency updated in VSCode extension config.
gradle.properties
mpp-ui/package.json
mpp-vscode/package.json
mpp-ui/package.json.backup
Core Plan State Management Enhanced plan state exposure and reactive updates. PlanStateService now reassigns plan to trigger StateFlow emissions; CodingAgent exposes getPlanStateService(); RendererUtils simplifies tool names; JS exports (JsCodingAgent, RendererExports) add observePlanState() and new summary data types (JsStepSummary, JsTaskSummary).
mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/{CodingAgent.kt,plan/PlanStateService.kt,render/RendererUtils.kt}
mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/{CodingAgentExports.kt,RendererExports.kt}
IDEA Plugin - File Change Tracking Infrastructure New file change tracking system with tracker service (IdeaFileChangeTracker), UI components for display and editing (IdeaFileChangeSummary, IdeaFileChangeItem), and diff dialog with undo/keep actions (IdeaFileChangeDiffDialog).
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/{IdeaFileChangeTracker.kt,IdeaFileChangeSummary.kt,IdeaFileChangeItem.kt,IdeaFileChangeDiffDialog.kt}
IDEA Plugin - Plan State Integration Plan state observer wired into ViewModel to sync agent plan updates with renderer; new setPlan() API on JewelRenderer; removed legacy task state tracking. IdeaDevInInputArea now displays file change summary.
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/{IdeaAgentViewModel.kt,IdeaDevInInputArea.kt}
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt
IDEA Plugin - Timeline & Terminal UI Terminal output bubble defaults to collapsed state; tool call bubble redesigned to show execution output/time in header instead of truncated params; OutputDisplay in terminal renderer commented out.
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/{IdeaTerminalOutputBubble.kt,IdeaToolCallBubble.kt}
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaTerminalRenderer.kt
Core Cross-platform ProcessExecutor now uses provided Project instance's basePath instead of retrieving via ProjectManager.
core/src/main/kotlin/cc/unitmesh/devti/sketch/run/ProcessExecutor.kt
VSCode Extension - CodeLens Infrastructure New CodeLens provider with tree-sitter-based code parsing supporting multiple languages (TypeScript, Python, Java, Kotlin, Go, Rust); code element extraction (methods, classes); configurable display modes.
mpp-vscode/src/providers/{codelens-provider.ts,code-element-parser.ts}
mpp-vscode/src/commands/codelens-commands.ts
VSCode Extension - Auto-generation Actions AutoComment, AutoTest, AutoMethod actions with LLM integration and diff-based code insertion. Prompt templates for language-specific code generation and test framework detection.
mpp-vscode/src/actions/auto-actions.ts
mpp-vscode/src/prompts/prompt-templates.ts
VSCode Extension - Chat & Integration ChatViewProvider now implements plan state observer, sends code context to webview, exposes model config; extension wires CodeLens provider and command handlers.
mpp-vscode/src/providers/chat-view.ts
mpp-vscode/src/extension.ts
VSCode Extension - Build & Config Added WASM copy script for tree-sitter artifacts; .gitignore and .vscodeignore updated; README significantly expanded with multilingual support, architecture, and feature documentation.
mpp-vscode/{scripts/copy-wasm.js,.gitignore,.vscodeignore,README.md}
VSCode Webview - State & Layout Plan state integrated into App; activeFile state removed; ChatInput and TopToolbar simplified (removed auto-add file feature); Timeline simplified (removed streaming headers, task-complete visual indicators).
mpp-vscode/webview/src/{App.tsx,App.css}
mpp-vscode/webview/src/components/{ChatInput.tsx,TopToolbar.tsx,Timeline.tsx,Timeline.css}
VSCode Webview - Sketch Renderers New DevInRenderer for interactive devin block rendering; SketchRenderer defers devin blocks to ToolCallRenderer; ToolCallRenderer removes rerun button; MarkdownRenderer filters devin tags; spacing/styling refinements across components.
mpp-vscode/webview/src/components/sketch/{DevInRenderer.tsx,DevInRenderer.css,SketchRenderer.tsx,SketchRenderer.css,ToolCallRenderer.tsx,ToolCallRenderer.css,MarkdownRenderer.tsx,MarkdownRenderer.css,index.ts}
VSCode Webview - Utilities codeFence parser refactored to handle devin, thinking, walkthrough tags as special blocks; added language display names and extension mapping. useVSCode hooks extended with planUpdate/planCleared message types.
mpp-vscode/webview/src/utils/codeFence.ts
mpp-vscode/webview/src/hooks/useVSCode.ts

Sequence Diagram(s)

sequenceDiagram
    participant IdeaAgentViewModel as IdeaAgentViewModel
    participant CodingAgent as CodingAgent
    participant PlanStateService as PlanStateService
    participant JewelRenderer as JewelRenderer
    participant UI as IDEA UI

    IdeaAgentViewModel->>CodingAgent: initializeCodingAgent()
    IdeaAgentViewModel->>IdeaAgentViewModel: startPlanStateObserver()
    IdeaAgentViewModel->>PlanStateService: subscribe to currentPlan
    
    Note over CodingAgent,PlanStateService: Agent executes plan
    CodingAgent->>PlanStateService: updateStatus()/completeStep()
    PlanStateService->>PlanStateService: mutate plan data
    PlanStateService->>PlanStateService: _currentPlan.value = plan<br/>(reassign to trigger emission)
    PlanStateService->>IdeaAgentViewModel: emit plan update
    
    IdeaAgentViewModel->>JewelRenderer: setPlan(plan)
    JewelRenderer->>UI: render plan with steps/tasks
    UI->>IdeaAgentViewModel: user interacts with changes
    IdeaAgentViewModel->>IdeaFileChangeTracker: process file changes
Loading
sequenceDiagram
    participant VFS as IntelliJ VFS
    participant IdeaFileChangeTracker as IdeaFileChangeTracker
    participant FileChangeTracker as FileChangeTracker
    participant IdeaFileChangeSummary as IdeaFileChangeSummary
    participant IdeaFileChangeDiffDialog as Diff Dialog

    VFS->>IdeaFileChangeTracker: bulk file change events
    IdeaFileChangeTracker->>IdeaFileChangeTracker: cache original content
    IdeaFileChangeTracker->>FileChangeTracker: recordChange(path, type, content)
    FileChangeTracker->>IdeaFileChangeSummary: emit changes
    
    IdeaFileChangeSummary->>IdeaFileChangeSummary: render changes list
    
    Note over IdeaFileChangeSummary,IdeaFileChangeDiffDialog: User action
    IdeaFileChangeSummary->>IdeaFileChangeDiffDialog: show(change)
    IdeaFileChangeDiffDialog->>IdeaFileChangeDiffDialog: renderDiffView()
    
    alt User clicks Undo
        IdeaFileChangeDiffDialog->>IdeaFileChangeTracker: rollback(change)
        IdeaFileChangeTracker->>VFS: restore file
    else User clicks Keep
        IdeaFileChangeDiffDialog->>FileChangeTracker: removeChange()
    end
Loading
sequenceDiagram
    participant Editor as VSCode Editor
    participant CodeLensProvider as AutoDevCodeLensProvider
    participant CodeElementParser as CodeElementParser
    participant TreeSitter as Tree-sitter
    participant CodelensCommands as CodeLensCommands
    participant AutoAction as Auto-action (Comment/Test/Method)
    participant LLMService as LLMService

    Editor->>CodeLensProvider: provideCodeLenses(document)
    CodeLensProvider->>CodeElementParser: parse(document)
    CodeElementParser->>TreeSitter: load language & parse tree
    TreeSitter-->>CodeElementParser: extract methods/classes
    CodeElementParser-->>CodeLensProvider: CodeElement[]
    
    CodeLensProvider->>CodeLensProvider: create CodeLens per action
    CodeLensProvider-->>Editor: render action buttons
    
    Note over Editor,LLMService: User clicks CodeLens action
    Editor->>CodelensCommands: onCommand (e.g., autoComment)
    CodelensCommands->>AutoAction: executeAutoComment(context)
    AutoAction->>LLMService: streamLLM(prompt)
    LLMService-->>AutoAction: response stream
    AutoAction->>AutoAction: parse response code block
    AutoAction->>Editor: applyDiff(changes)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

  • Heterogeneous scope: Changes span Kotlin multiplatform (commonMain/jsMain), IntelliJ IDEA plugin, VSCode extension (TypeScript/TSX), and webview UI across 40+ files
  • Multiple subsystems: Plan state observability, file change tracking, CodeLens architecture, code parsing, auto-generation, and reactive UI wiring
  • High logic density in key areas:
    • code-element-parser.ts — Tree-sitter integration with fallback regex parsing across 7 languages (~300+ lines)
    • IdeaFileChangeTracker.kt — VFS event subscription, content caching, VCS change sync
    • RendererExports.kt — JS-exported summary types and data conversions
    • chat-view.ts — Plan state observer lifecycle and messaging protocol expansion
  • Integration complexity: Plan state flows from CodingAgent → PlanStateService → IDEA/VSCode UI; file changes tracked and rendered across multiple components
  • Areas requiring extra attention:
    • State management correctness in PlanStateService (reassignment to trigger emissions)
    • Tree-sitter parser error handling and WASM loading in code-element-parser.ts
    • File change tracking scope (only current-project files) and undo/rollback logic in IdeaFileChangeTracker and IdeaFileChangeSummary
    • CodeLens command registration and integration with chat/model-config providers in extension.ts
    • Webview message protocol changes (planUpdate/planCleared) and component prop updates (activeFile removal)

Possibly related PRs

  • Feat task tracking UI 959ce #466: Modifies agent/plan/task state surface and plan-state handling/exports; introduces plan/task UI wiring similar to this PR's plan state observability enhancements.
  • feat: add basic MPP IDEA support #471 #473: Overlaps with IntelliJ IDEA plugin changes (IdeaAgentViewModel, JewelRenderer, timeline components); related architectural improvements to mpp-idea modules.

Poem

🐰 A rabbit hops through states so grand,
Plan observers span the land,
File changes tracked with care precise,
CodeLens hints—advice so nice,
From IDE to web, all flows divine,
Version bumped to 0.3.4—all align!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3d9ec96 and d3de8fa.

⛔ Files ignored due to path filters (4)
  • mpp-vscode/media/autodev-dark.svg is excluded by !**/*.svg
  • mpp-vscode/media/autodev.woff is excluded by !**/*.woff
  • mpp-vscode/media/icon.svg is excluded by !**/*.svg
  • mpp-vscode/media/pluginIcon.png is excluded by !**/*.png
📒 Files selected for processing (49)
  • core/src/main/kotlin/cc/unitmesh/devti/sketch/run/ProcessExecutor.kt (1 hunks)
  • gradle.properties (1 hunks)
  • mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/CodingAgent.kt (1 hunks)
  • mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/plan/PlanStateService.kt (1 hunks)
  • mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/RendererUtils.kt (1 hunks)
  • mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/CodingAgentExports.kt (2 hunks)
  • mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/RendererExports.kt (3 hunks)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaTerminalOutputBubble.kt (1 hunks)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt (5 hunks)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt (4 hunks)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaTerminalRenderer.kt (1 hunks)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt (2 hunks)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaDevInInputArea.kt (2 hunks)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeDiffDialog.kt (1 hunks)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeItem.kt (1 hunks)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeSummary.kt (1 hunks)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeTracker.kt (1 hunks)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt (1 hunks)
  • mpp-ui/package.json (1 hunks)
  • mpp-ui/package.json.backup (1 hunks)
  • mpp-vscode/.gitignore (1 hunks)
  • mpp-vscode/.vscodeignore (1 hunks)
  • mpp-vscode/README.md (1 hunks)
  • mpp-vscode/package.json (5 hunks)
  • mpp-vscode/scripts/copy-wasm.js (1 hunks)
  • mpp-vscode/src/actions/auto-actions.ts (1 hunks)
  • mpp-vscode/src/commands/codelens-commands.ts (1 hunks)
  • mpp-vscode/src/extension.ts (2 hunks)
  • mpp-vscode/src/prompts/prompt-templates.ts (1 hunks)
  • mpp-vscode/src/providers/chat-view.ts (6 hunks)
  • mpp-vscode/src/providers/code-element-parser.ts (1 hunks)
  • mpp-vscode/src/providers/codelens-provider.ts (1 hunks)
  • mpp-vscode/webview/src/App.css (1 hunks)
  • mpp-vscode/webview/src/App.tsx (5 hunks)
  • mpp-vscode/webview/src/components/ChatInput.tsx (0 hunks)
  • mpp-vscode/webview/src/components/Timeline.css (2 hunks)
  • mpp-vscode/webview/src/components/Timeline.tsx (1 hunks)
  • mpp-vscode/webview/src/components/TopToolbar.tsx (1 hunks)
  • mpp-vscode/webview/src/components/sketch/DevInRenderer.css (1 hunks)
  • mpp-vscode/webview/src/components/sketch/DevInRenderer.tsx (1 hunks)
  • mpp-vscode/webview/src/components/sketch/MarkdownRenderer.css (4 hunks)
  • mpp-vscode/webview/src/components/sketch/MarkdownRenderer.tsx (2 hunks)
  • mpp-vscode/webview/src/components/sketch/SketchRenderer.css (0 hunks)
  • mpp-vscode/webview/src/components/sketch/SketchRenderer.tsx (1 hunks)
  • mpp-vscode/webview/src/components/sketch/ToolCallRenderer.css (1 hunks)
  • mpp-vscode/webview/src/components/sketch/ToolCallRenderer.tsx (1 hunks)
  • mpp-vscode/webview/src/components/sketch/index.ts (3 hunks)
  • mpp-vscode/webview/src/hooks/useVSCode.ts (1 hunks)
  • mpp-vscode/webview/src/utils/codeFence.ts (2 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@phodal phodal merged commit eb1588a into phodal:master Dec 4, 2025
5 of 6 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds comprehensive VSCode extension support for the AutoDev KMP (Kotlin Multiplatform) Edition, along with version 0.5.3 publish preparation. The changes establish a full-featured AI coding assistant with CodeLens, chat interface, and agent capabilities.

Key Changes

  • CodeLens Infrastructure: New Tree-sitter-based code parsing for 8 languages with inline AI actions (Quick Chat, Explain, Optimize, AutoComment, AutoTest, AutoMethod)
  • Webview Enhancements: Improved markdown rendering, DevIn block handling, plan summary display, and UI refinements with better spacing/margins
  • Agent System Updates: Plan state observability via new observePlanState() method, file change tracking, and improved state synchronization between mpp-core and UI layers

Reviewed changes

Copilot reviewed 49 out of 53 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
mpp-vscode/package.json Version bump to 0.5.3, added dependencies (web-tree-sitter, treesitter-artifacts), new CodeLens commands and configuration
mpp-vscode/src/providers/codelens-provider.ts New CodeLens provider with language-specific parsing and action display
mpp-vscode/src/providers/code-element-parser.ts Tree-sitter AST parser with regex fallback for 8 languages
mpp-vscode/src/prompts/prompt-templates.ts Template generation for AutoDoc, AutoTest, AutoMethod actions
mpp-vscode/src/commands/codelens-commands.ts Command handlers for all CodeLens actions
mpp-vscode/src/actions/auto-actions.ts Action executors for AutoComment, AutoTest, AutoMethod with LLM integration
mpp-vscode/webview/src/utils/codeFence.ts Enhanced markdown code fence parser supporting devin blocks, thinking tags, walkthrough comments
mpp-vscode/webview/src/components/sketch/* New DevInRenderer, improved MarkdownRenderer with devin tag filtering, updated styling
mpp-vscode/webview/src/App.tsx Plan state integration, increased max iterations (10→100), removed auto-add file feature
mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/* New observePlanState() method, enhanced plan summary exports with tasks/steps
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/* File change tracking system, plan summary bar improvements, terminal output collapse by default
README.md Complete rewrite with KMP branding, feature documentation, architecture details
scripts/copy-wasm.js WASM file deployment script for Tree-sitter grammars

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

// Sort by position
tagMatches.sort((a, b) => a.match.index - b.match.index);
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 sort operation may be unstable for ties. Since a.match.index - b.match.index is used, identical indices (unlikely but possible) won't have a defined order. Consider adding a secondary sort key if tag order matters when indices are equal.

Copilot uses AI. Check for mistakes.

// Parse key="value" or key=value patterns
// Note: Does not handle escaped quotes within quoted values
const paramRegex = /([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\S+))/g;
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 parser does not handle escaped quotes within quoted values as noted in the comment on lines 26-27. This could lead to incorrect parameter parsing for values like key="value with \"escaped\"". Consider using a more robust parser or documenting this limitation in user-facing documentation.

Copilot uses AI. Check for mistakes.
"build": "npm run build:extension && npm run build:webview",
"build:extension": "esbuild ./src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --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",
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 external bundle exclusions --external:ws --external:web-tree-sitter should be documented in a README or configuration file explaining why these packages need to be excluded from the bundle. This helps future maintainers understand the build requirements.

Copilot uses AI. Check for mistakes.
isProcessing: false,
currentIteration: 0,
maxIterations: 10,
maxIterations: 100,
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 maxIterations value changed from 10 to 100. This is a significant increase (10x) that could impact performance and costs for LLM API calls. Consider adding configuration validation or user warnings if this high iteration count is reached, as it might indicate an infinite loop or inefficient task.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments