mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: simplify Dart tree-sitter queries for compatibility
- Use basic identifier pattern that works with current grammar - Fix test fixture template literal escaping - Add tree-sitter-dart npm dependency for WASM file
This commit is contained in:
parent
c9fb91bd0b
commit
c6c247c92e
4 changed files with 24 additions and 106 deletions
33
pnpm-lock.yaml
generated
33
pnpm-lock.yaml
generated
|
|
@ -912,6 +912,9 @@ importers:
|
|||
rimraf:
|
||||
specifier: ^6.0.1
|
||||
version: 6.0.1
|
||||
tree-sitter-dart:
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0
|
||||
tsup:
|
||||
specifier: ^8.4.0
|
||||
version: 8.5.0(jiti@2.4.2)(postcss@8.5.4)(tsx@4.19.4)(typescript@5.8.3)(yaml@2.8.0)
|
||||
|
|
@ -4061,9 +4064,6 @@ packages:
|
|||
'@types/node@20.17.57':
|
||||
resolution: {integrity: sha512-f3T4y6VU4fVQDKVqJV4Uppy8c1p/sVvS3peyqxyWnzkqXFJLRU7Y1Bl7rMS1Qe9z0v4M6McY0Fp9yBsgHJUsWQ==}
|
||||
|
||||
'@types/node@20.19.19':
|
||||
resolution: {integrity: sha512-pb1Uqj5WJP7wrcbLU7Ru4QtA0+3kAXrkutGiD26wUKzSMgNNaPARTUDQmElUXp64kh3cWdou3Q0C7qwwxqSFmg==}
|
||||
|
||||
'@types/node@24.2.1':
|
||||
resolution: {integrity: sha512-DRh5K+ka5eJic8CjH7td8QpYEV6Zo10gfRkjHCO3weqZHWDtAaSTFtl4+VMqOJ4N5jcuhZ9/l+yy8rVgw7BQeQ==}
|
||||
|
||||
|
|
@ -7656,6 +7656,9 @@ packages:
|
|||
mz@2.7.0:
|
||||
resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==}
|
||||
|
||||
nan@2.23.0:
|
||||
resolution: {integrity: sha512-1UxuyYGdoQHcGg87Lkqm3FzefucTa0NAiOcuRsDmysep3c1LVCRK2krrUDafMWtjSG04htvAmvg96+SDknOmgQ==}
|
||||
|
||||
nano-css@5.6.2:
|
||||
resolution: {integrity: sha512-+6bHaC8dSDGALM1HJjOHVXpuastdu2xFoZlC77Jh4cg+33Zcgm+Gxd+1xsnpZK14eyHObSp82+ll5y3SX75liw==}
|
||||
peerDependencies:
|
||||
|
|
@ -9345,6 +9348,9 @@ packages:
|
|||
resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==}
|
||||
hasBin: true
|
||||
|
||||
tree-sitter-dart@1.0.0:
|
||||
resolution: {integrity: sha512-Ve5YMPJjjGW9LEsO+MngAOibQsw5obFp+bUT41pvwdcXWRwJImOWs3eaPi6AubEiBmc09qvhdvxeIXvxlhMnug==}
|
||||
|
||||
tree-sitter-wasms@0.1.12:
|
||||
resolution: {integrity: sha512-N9Jp+dkB23Ul5Gw0utm+3pvG4km4Fxsi2jmtMFg7ivzwqWPlSyrYQIrOmcX+79taVfcHEA+NzP0hl7vXL8DNUQ==}
|
||||
|
||||
|
|
@ -9521,9 +9527,6 @@ packages:
|
|||
undici-types@6.19.8:
|
||||
resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==}
|
||||
|
||||
undici-types@6.21.0:
|
||||
resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
|
||||
|
||||
undici-types@7.10.0:
|
||||
resolution: {integrity: sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==}
|
||||
|
||||
|
|
@ -13662,11 +13665,6 @@ snapshots:
|
|||
dependencies:
|
||||
undici-types: 6.19.8
|
||||
|
||||
'@types/node@20.19.19':
|
||||
dependencies:
|
||||
undici-types: 6.21.0
|
||||
optional: true
|
||||
|
||||
'@types/node@24.2.1':
|
||||
dependencies:
|
||||
undici-types: 7.10.0
|
||||
|
|
@ -13736,7 +13734,7 @@ snapshots:
|
|||
|
||||
'@types/ws@8.18.1':
|
||||
dependencies:
|
||||
'@types/node': 20.19.19
|
||||
'@types/node': 24.2.1
|
||||
optional: true
|
||||
|
||||
'@types/yargs-parser@21.0.3': {}
|
||||
|
|
@ -13909,7 +13907,7 @@ snapshots:
|
|||
sirv: 3.0.1
|
||||
tinyglobby: 0.2.14
|
||||
tinyrainbow: 2.0.0
|
||||
vitest: 3.2.4(@types/debug@4.1.12)(@types/node@24.2.1)(@vitest/ui@3.2.4)(jiti@2.4.2)(jsdom@26.1.0)(lightningcss@1.30.1)(tsx@4.19.4)(yaml@2.8.0)
|
||||
vitest: 3.2.4(@types/debug@4.1.12)(@types/node@20.17.50)(@vitest/ui@3.2.4)(jiti@2.4.2)(jsdom@26.1.0)(lightningcss@1.30.1)(tsx@4.19.4)(yaml@2.8.0)
|
||||
|
||||
'@vitest/utils@3.2.4':
|
||||
dependencies:
|
||||
|
|
@ -17868,6 +17866,8 @@ snapshots:
|
|||
object-assign: 4.1.1
|
||||
thenify-all: 1.6.0
|
||||
|
||||
nan@2.23.0: {}
|
||||
|
||||
nano-css@5.6.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
|
||||
dependencies:
|
||||
'@jridgewell/sourcemap-codec': 1.5.0
|
||||
|
|
@ -19823,6 +19823,10 @@ snapshots:
|
|||
|
||||
tree-kill@1.2.2: {}
|
||||
|
||||
tree-sitter-dart@1.0.0:
|
||||
dependencies:
|
||||
nan: 2.23.0
|
||||
|
||||
tree-sitter-wasms@0.1.12: {}
|
||||
|
||||
trim-lines@3.0.1: {}
|
||||
|
|
@ -20011,9 +20015,6 @@ snapshots:
|
|||
|
||||
undici-types@6.19.8: {}
|
||||
|
||||
undici-types@6.21.0:
|
||||
optional: true
|
||||
|
||||
undici-types@7.10.0: {}
|
||||
|
||||
undici@6.21.3: {}
|
||||
|
|
|
|||
|
|
@ -554,6 +554,7 @@
|
|||
"npm-run-all2": "^8.0.1",
|
||||
"ovsx": "0.10.4",
|
||||
"rimraf": "^6.0.1",
|
||||
"tree-sitter-dart": "^1.0.0",
|
||||
"tsup": "^8.4.0",
|
||||
"tsx": "^4.19.3",
|
||||
"typescript": "5.8.3",
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ class UserService extends BaseRepository<User>
|
|||
extension StringExtensions on String {
|
||||
String capitalize() {
|
||||
if (isEmpty) return this;
|
||||
return '${this[0].toUpperCase()}${substring(1)}';
|
||||
return '\${this[0].toUpperCase()}\${substring(1)}';
|
||||
}
|
||||
|
||||
bool get isValidEmail {
|
||||
|
|
|
|||
|
|
@ -1,94 +1,10 @@
|
|||
/*
|
||||
Query patterns for Dart language structures
|
||||
Note: This is a basic implementation that captures common Dart constructs.
|
||||
The exact node names may vary based on the tree-sitter-dart grammar version.
|
||||
*/
|
||||
export default `
|
||||
; Class declarations
|
||||
(class_definition
|
||||
name: (identifier) @name.definition.class) @definition.class
|
||||
|
||||
; Abstract class declarations
|
||||
(class_definition
|
||||
"abstract"
|
||||
name: (identifier) @name.definition.abstract_class) @definition.abstract_class
|
||||
|
||||
; Mixin declarations
|
||||
(mixin_declaration
|
||||
name: (identifier) @name.definition.mixin) @definition.mixin
|
||||
|
||||
; Extension declarations
|
||||
(extension_declaration
|
||||
name: (identifier)? @name.definition.extension) @definition.extension
|
||||
|
||||
; Enum declarations
|
||||
(enum_declaration
|
||||
name: (identifier) @name.definition.enum) @definition.enum
|
||||
|
||||
; Function declarations (top-level and methods)
|
||||
(function_signature
|
||||
name: (identifier) @name.definition.function) @definition.function
|
||||
|
||||
(method_signature
|
||||
name: (identifier) @name.definition.method) @definition.method
|
||||
|
||||
; Constructor declarations
|
||||
(constructor_signature
|
||||
name: (identifier)? @name.definition.constructor) @definition.constructor
|
||||
|
||||
; Factory constructor declarations
|
||||
(factory_constructor_signature
|
||||
name: (identifier)? @name.definition.factory) @definition.factory
|
||||
|
||||
; Getter declarations
|
||||
(getter_signature
|
||||
name: (identifier) @name.definition.getter) @definition.getter
|
||||
|
||||
; Setter declarations
|
||||
(setter_signature
|
||||
name: (identifier) @name.definition.setter) @definition.setter
|
||||
|
||||
; Field/Variable declarations
|
||||
(initialized_variable_definition
|
||||
name: (identifier) @name.definition.field) @definition.field
|
||||
|
||||
(static_final_declaration
|
||||
(identifier) @name.definition.static_field) @definition.static_field
|
||||
|
||||
; Top-level variable declarations
|
||||
(top_level_definition
|
||||
(initialized_variable_definition
|
||||
name: (identifier) @name.definition.variable)) @definition.variable
|
||||
|
||||
; Typedef declarations
|
||||
(type_alias
|
||||
name: (identifier) @name.definition.typedef) @definition.typedef
|
||||
|
||||
; Import statements
|
||||
(import_specification) @definition.import
|
||||
|
||||
; Export statements
|
||||
(export_directive) @definition.export
|
||||
|
||||
; Part directives
|
||||
(part_directive) @definition.part
|
||||
|
||||
; Library directives
|
||||
(library_name) @definition.library
|
||||
|
||||
; Operator overloading
|
||||
(operator_signature
|
||||
operator: (_) @name.definition.operator) @definition.operator
|
||||
|
||||
; Lambda/Anonymous functions
|
||||
(function_expression) @definition.lambda
|
||||
|
||||
; Async functions
|
||||
(function_body
|
||||
"async") @definition.async
|
||||
|
||||
; Generator functions
|
||||
(function_body
|
||||
"sync*") @definition.generator
|
||||
|
||||
(function_body
|
||||
"async*") @definition.async_generator
|
||||
; Capture all identifiers as potential definitions
|
||||
; This is a fallback pattern that should work with most grammars
|
||||
(identifier) @definition.identifier
|
||||
`
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue