Skip to content

Conversation

@nang-dev
Copy link

@nang-dev nang-dev commented May 1, 2025

Context

Implementation

Screenshots

before after

How to Test

Get in Touch

github-actions bot and others added 30 commits April 25, 2025 23:53
docs: update contributors list [skip ci]

Co-authored-by: mrubens <mrubens@users.noreply.github.com>
* changeset version bump

* Update package.json

* Update package-lock.json

* Update CHANGELOG.md

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
* Enhance export method in ContextProxy to filter out project custom modes, ensuring only global settings are included in the export.

* Fix issue of customModes not being imported when importing settings.

The problem was that the Custom modes are managed by the CustomModesManager, not by the context proxy.

* * Fix tests

* Update webviewMessageHandler to provide customModeManager to importSettings
Run linting checks alongside tests to catch style and formatting issues before pushing code or creating PRs, saving developers time by identifying problems earlier.

- Added lint:* to npm test command execution
- Maintains parallel execution on non-Windows systems

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org>
…2997)

* Fix mode switching performance in PromptsView by using local state for instant UI updates

* Update webview-ui/src/components/prompts/PromptsView.tsx

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

---------

Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* refactor: standardize C# Tree-Sitter parser tests

This commit standardizes the C# Tree-Sitter parser tests to ensure:
- Variable/function names in sample code match the tests
- Each test only verifies specific identifiers relevant to that test
- Test names clearly indicate what they're testing
- No skipped tests remain
- Only one test exists per structure or combination of structures
- All debug output uses debugLog from helpers.ts

The standardization improves maintainability and clarity while preserving
all existing functionality.

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* refactor: standardize C Tree-Sitter parser tests

This commit standardizes the C Tree-Sitter parser tests to ensure:
- Variable/function names in sample code match the tests (using snake_case)
- Each test only verifies specific identifiers relevant to that test
- Test names clearly indicate what they're testing
- No skipped tests remain - tests for unsupported features are removed
- Only one test exists per structure or combination of structures
- All debug output uses debugLog from helpers.ts

The standardization improves maintainability and clarity while preserving
all existing functionality. Documentation has been added for C language
constructs that are not currently supported by the parser.

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* feat: standardize Kotlin Tree-Sitter parser

Standardized Kotlin Tree-Sitter parser to ensure consistent naming and structure:
- Renamed identifiers to clearly indicate what they're testing
- Ensured all code sections are at least 4 lines long
- Organized query patterns logically with clear comments
- Removed skipped tests and unused query patterns
- Ensured only one test per structure or combination of structures

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* feat: standardize PHP Tree-Sitter parser

Standardized PHP Tree-Sitter parser to ensure consistent naming and structure:
- Renamed identifiers to clearly indicate what they're testing
- Ensured all code sections are at least 4 lines long
- Organized query patterns logically with clear comments
- Consolidated related tests to ensure only one test per structure
- Ensured all debug output uses debugLog from helpers.ts

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* feat: standardize Ruby Tree-Sitter parser

Standardized Ruby Tree-Sitter parser to ensure consistent naming and structure:
- Expanded query to support many more Ruby language constructs
- Added comprehensive test file with clear section headers
- Ensured all code sections are at least 4 lines long
- Added tests for each language construct
- Used consistent naming conventions for test identifiers

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* feat: standardize Swift Tree-Sitter parser

Standardized Swift Tree-Sitter parser to ensure consistent naming and structure:
- Renamed identifiers to clearly indicate what they're testing
- Ensured all code sections are at least 4 lines long
- Organized query patterns logically with clear comments
- Removed skipped tests and unused query patterns
- Ensured only one test per structure or combination of structures

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* feat: dynamically include all tree-sitter WASM files in build process

- Modified esbuild.js to dynamically read and copy all WASM files from tree-sitter-wasms package
- Added error handling and logging for better debugging
- Ensures all language parsers are automatically included without requiring manual updates

* refactor: move test mocks and fixtures to shared locations

Move test mocks to helpers.ts to be shared between test files
Create fixtures directory for shared test data
Move sample TSX content to fixtures/sample-tsx.ts
Update test files to use shared mocks and fixtures

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* refactor: simplify tree-sitter debug output

- Remove detailed node inspection to reduce noise
- Keep only essential tree structure output
- Remove duplicate content logging

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* refactor: standardize C# tree-sitter test structure

Move C# sample code to dedicated fixture file and create inspectCSharp test
following the same pattern as other language tests. This improves test
organization and maintainability by:

- Extracting sample C# code to fixtures/sample-c-sharp.ts
- Adding inspectCSharp.test.ts for tree structure inspection
- Updating parseSourceCodeDefinitions.c-sharp.test.ts to use fixture

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* feat: add language-specific capture processing

- Add language parameter to processCaptures for language-specific handling
- Implement selective HTML filtering for jsx/tsx files
- Update all call sites to pass correct language parameter
- Fix type safety by properly passing language strings

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* refactor: move tree-sitter test samples to fixtures

Move sample code from parseSourceCodeDefinitions test files into dedicated
fixtures directory for better organization and reuse:

- Created fixtures directory for language samples
- Moved sample code for C#, C, JSON, Kotlin, PHP, Ruby, Rust, and Swift
- Created inspect test files for each language
- Updated original test files to import from fixtures
- Standardized test options across languages
- No behavior changes, all tests passing

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* refactor: standardize tree-sitter test code across languages

Standardize test code structure and naming across all language parsers:
- Rename identifiers to clearly indicate test purpose
- Ensure each code section has descriptive comments
- Group related code sections together
- Maintain language-specific naming conventions
- Keep test structure consistent across languages
- Remove tests for unsupported features

Changes made to:
- C, JSON, Kotlin, PHP, Ruby, Rust, and Swift test files
- Sample code fixtures
- Parser definition tests
- Inspect structure tests

No functional changes - all tests passing with improved maintainability.

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* refactor: standardize tree-sitter parser tests across all languages

- Ensure all test structures span at least 4 lines for better parsing
- Create exactly one consolidated test per data structure type
- Use descriptive names that clearly indicate test purpose
- Improve query pattern organization and documentation
- Simplify inspect test files to focus on structure validation
- Implement result caching in test files for better performance
- Remove duplicate and skipped tests
- Follow consistent naming conventions across all languages

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* first pass all but elm-bash

* test: inspectTreeStructure helper now returns a string

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* refactor: establish single source of truth for MIN_COMPONENT_LINES

- Move minComponentLines parameter to a file-level constant
- Remove parameter passing to processCaptures function
- Update all references to use the global constant
- Remove redundant local constant declaration in parseFile

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* refactor: improve MIN_COMPONENT_LINES implementation

- Changed MIN_COMPONENT_LINES constant to use getter/setter functions
- Updated references to use getMinComponentLines() function
- Modified test helper to set value to 0 during tests
- This establishes a single source of truth while making testing easier

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* feat: standardize tree-sitter test implementations

Standardized tree-sitter test implementations across all supported languages:
- Removed debugLog calls from test files
- Implemented consistent line number pattern matching
- Ensured proper test structure and execution order
- Added comprehensive test coverage for supported structures
- Maintained 1:1 mapping between queries, tests and samples
- Documented unsupported features in TODO sections

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* docs: document tree-sitter parseable but unsupported structures

Added TODO sections in test files documenting structures that can be parsed
by tree-sitter but currently lack query pattern support:

- Python: f-strings, complex type annotations, pattern matching
- C++: virtual methods, field initializers, base class clauses
- Java: import declarations, field declarations with modifiers
- TSX: React hooks, context providers, event handlers

Added examples and clarifying comments to existing TODO sections.
Enhanced Java query patterns for better structure capture including
lambda expressions, field declarations, and type parameters.

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* fix: use correct distDir variable for WASM file copying

The copyWasmFiles plugin was using an undefined targetDir variable when copying
tree-sitter WASM files. Changed to use the correctly defined distDir variable,
fixing the build process.

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* lint: remove unused imports and variables from tree-sitter tests

Removed unused imports and variables from tree-sitter test files to fix linting errors:
- Removed unused goQuery import from helpers.ts
- Removed unused imports and mockedFs variables from language-specific test files
- Cleaned up test files to only import what they use

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

---------

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org>
* feat: syntax highlighting terminal output with Shiki

Refactored CommandExecution.tsx to:
- Implement CodeBlock component for terminal display
- Use Shiki for syntax highlighting of shell commands and terminal output

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* ui: present same compressed command output that the model will receive

Avoids rendering problems and performance regressions:
- Compresses output using BaseTerminal.compressTerminalOutput
- Eliminates need for Virtuoso by limiting output size

Ensures command output shown in UI matches the compressed format provided to the model:
- Applies same BaseTerminal.compressTerminalOutput processing
- Uses configured terminalOutputLineLimit for consistency

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* test: update CommandExecution tests to use CodeBlock mock

- Replace virtuoso mock with CodeBlock mock to fix shiki import error
- Update CodeBlock mock to properly handle source prop
- Add proper empty output test case verification
- Keep original test values and structure

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

---------

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org>
…eInc#3023)

Revert "feat: syntax highlighting terminal output with Shiki (RooCodeInc#3021)"

This reverts commit 8b072ad.
* Quick fix actions

* Remove unused keys

* Simplify more stuff

* Bring back "Explain Code"

* Bring "Improve Code" back

* Add back "Improve"

* This is too flakey for now
…grounded (RooCodeInc#3031)

* Set busy flag on ExecaTerminal so it reports in env details when backgrounded

* Revert this
* Count tokens worker

* Appease knip
Add test to verify presence of all required WASM files in dist directory:
- tiktoken_bg.wasm for tokenization
- tree-sitter.wasm core parser
- Language-specific tree-sitter WASM files for syntax highlighting

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org>
* Support mentioning filenames with spaces

Allows spaces to be escaped in mentions with \. Does not attempt more
comprehensive escape handling. (IMO a more structured representation or
moving to something like @[something complex] is probably a better long
term approach, but the scope of that seems problematic.

Adapted from 8955d45.

Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>

* Older array creation to make check-types happier

---------

Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
* Fix: Adjust padding in chat view for better UI

* Add transition for chat view padding
docs: update contributors list [skip ci]

Co-authored-by: mrubens <mrubens@users.noreply.github.com>
cte and others added 13 commits April 29, 2025 21:10
* changeset version bump

* Update CHANGELOG.md

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Chris Estreich <cestreich@gmail.com>
* Update sound logic to be centralized and only run when action is needed from user

* Handle cases like questions and resuming
…eInc#3068)

* Treat HistoryView item clicks as (de)select in selection mode

* UI tweaks

---------

Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
* @returns A path with spaces escaped
*/
export function escapeSpaces(path: string): string {
return path.replace(/ /g, "\\ ")

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This does not escape backslash characters in the input.

Copilot Autofix

AI 8 months ago

To fix the issue, we need to ensure that backslashes in the input are escaped before escaping spaces. This can be achieved by first replacing all backslashes (\) with double backslashes (\\) and then replacing spaces with \ . This approach ensures that the output is unambiguous and correctly escaped.

The fix involves modifying the escapeSpaces function to handle backslashes in addition to spaces. Specifically:

  1. Replace all backslashes in the input with double backslashes using path.replace(/\\/g, "\\\\").
  2. Replace all spaces with \ using path.replace(/ /g, "\\ ").
Suggested changeset 1
webview-ui/src/utils/path-mentions.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/webview-ui/src/utils/path-mentions.ts b/webview-ui/src/utils/path-mentions.ts
--- a/webview-ui/src/utils/path-mentions.ts
+++ b/webview-ui/src/utils/path-mentions.ts
@@ -11,3 +11,4 @@
 export function escapeSpaces(path: string): string {
-	return path.replace(/ /g, "\\ ")
+	// Escape backslashes first, then escape spaces
+	return path.replace(/\\/g, "\\\\").replace(/ /g, "\\ ");
 }
EOF
@@ -11,3 +11,4 @@
export function escapeSpaces(path: string): string {
return path.replace(/ /g, "\\ ")
// Escape backslashes first, then escape spaces
return path.replace(/\\/g, "\\\\").replace(/ /g, "\\ ");
}
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@nang-dev nang-dev merged commit b7f1ebf into main May 1, 2025
6 of 12 checks passed
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.