Commit graph

19 commits

Author SHA1 Message Date
vagadiya
4550a91950
#3679 - Fixes packaging to include correct tiktoken.wasm (lite) (#3697)
- also, additions to .gitignore and .vscodeignore to prevent the IntelliJ .idea and .qodo folders from being included for git and packaging.
2025-05-17 13:53:33 -07:00
Chris Estreich
67ec7560ee
Copy tree-sitter.wasm to dist (#3046) 2025-04-29 16:12:13 -07:00
Chris Estreich
65cb9244ee
Count tokens worker (#3037)
* Count tokens worker

* Appease knip
2025-04-29 12:29:25 -07:00
KJ7LNW
8e85a121f1
feat: standardize tree-sitter test implementations (#2960)
* 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>
2025-04-28 11:27:49 -04:00
Chris Estreich
06db547308
Use a WASM-based tiktoken implementation (#2859)
* Use a WASM-based tiktoken implementation

* Clean up imports
2025-04-25 10:32:35 -07:00
Matt Rubens
38655825d4
Extension-side internationalization (#1757)
* Extension-side internationalization

* Update script

* Cleaner esbuild

* Turn off debugging

* PR feedback

* Update src/i18n/locales/en/common.json

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

* Update src/i18n/locales/ca/common.json

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

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-03-18 10:39:21 -04:00
aheizi
6f5ce14586 upgrade @modelcontextprotocol/sdk to latest version
(cherry picked from commit f9cc13cb1e)
2025-03-17 14:39:39 +08:00
Matt Rubens
b29f94ae65
Revert "feat: add sse mcp support" 2025-03-13 13:00:32 -04:00
aheizi
f9cc13cb1e upgrade @modelcontextprotocol/sdk to latest version 2025-03-12 18:57:59 +08:00
kohii
1cd90a655b feat: Add Kotlin support in list_code_definition_names 2025-02-02 10:17:57 +09:00
Saoud Rizwan
3e58160d99 Replace token estimation with using last API response token usage 2024-08-30 22:29:18 -04:00
Saoud Rizwan
2e93928c8f Add php tree-sitter-wasm 2024-08-29 07:15:35 -04:00
Saoud Rizwan
2a0a5435bc Add build step for tiktoken wasm 2024-08-26 01:00:00 -04:00
Saoud Rizwan
d93a08af5d Revert "Remove web-tree-sitter"
This reverts commit 5c98a3d4af.

# Conflicts:
#	package.json
2024-07-31 07:56:42 -04:00
Saoud Rizwan
5c98a3d4af Remove web-tree-sitter 2024-07-30 12:51:18 -04:00
Saoud Rizwan
303da320aa Add analyze_project tool 2024-07-26 23:56:10 -04:00
Saoud Rizwan
4916b2c28d Remove previous webview since we use react app now 2024-07-06 02:54:27 -04:00
Saoud Rizwan
0ede211d4f Add vscode-webview-ui-toolkit and follow tutorial to get started 2024-07-06 00:40:50 -04:00
Saoud Rizwan
9f169b7e4b Initial commit 2024-07-05 20:51:41 -04:00