sweet-search 2.6.1 → 2.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -51,9 +51,29 @@ export const ROUTING_CONFIG = {
|
|
|
51
51
|
export const FILE_PATTERNS = {
|
|
52
52
|
include: [
|
|
53
53
|
// Source code (all major languages)
|
|
54
|
-
'**/*.{js,jsx,ts,tsx,mjs,cjs}',
|
|
54
|
+
'**/*.{js,jsx,ts,tsx,mjs,cjs,cts,mts}', // JavaScript/TypeScript (incl. CommonJS/ESM TS)
|
|
55
55
|
'**/*.{java,kt,kts,scala,groovy}', // JVM
|
|
56
56
|
'**/*.{clj,cljc,cljs,edn}', // Clojure / ClojureScript / EDN
|
|
57
|
+
'**/*.jl', // Julia
|
|
58
|
+
'**/*.{R,r,Rd,rd,Rmd,rmd}', // R (case-sensitive matcher: list both cases)
|
|
59
|
+
'**/*.{ml,mli,mll,mly}', // OCaml
|
|
60
|
+
'**/*.{res,resi}', // ReScript
|
|
61
|
+
'**/*.{hs,lhs}', // Haskell
|
|
62
|
+
'**/*.{erl,hrl}', // Erlang
|
|
63
|
+
'**/*.{pl,pm,pod}', // Perl
|
|
64
|
+
'**/*.{f,for,f90,f95,f03,f08,F,F90,F95}', // Fortran (case-sensitive)
|
|
65
|
+
'**/*.{cob,cbl}', // COBOL
|
|
66
|
+
'**/*.{asm,s,S}', // Assembly (case-sensitive)
|
|
67
|
+
'**/*.{cr,vala,hx,pas,nix,vim}', // Crystal / Vala / Haxe / Pascal / Nix / Vim
|
|
68
|
+
'**/*.{elm,sol,tla,rdl,el,ejs}', // Elm / Solidity / TLA+ / SystemRDL / Emacs Lisp / EJS
|
|
69
|
+
'**/*.{ql,qll}', // CodeQL
|
|
70
|
+
'**/*.{zeek,bro}', // Zeek
|
|
71
|
+
'**/*.{tcl,tk}', // Tcl
|
|
72
|
+
'**/*.astro', // Astro (SFC)
|
|
73
|
+
// GPU shaders
|
|
74
|
+
'**/*.{glsl,vert,frag,comp,geom,tesc,tese}', // GLSL
|
|
75
|
+
'**/*.{hlsl,hlsli}', // HLSL
|
|
76
|
+
'**/*.{metal,wgsl,shader,cg,cginc}', // Metal / WGSL / ShaderLab / Cg
|
|
57
77
|
'**/*.{py,pyi}', // Python
|
|
58
78
|
'**/*.go', // Go
|
|
59
79
|
'**/*.rs', // Rust
|
|
@@ -72,7 +92,10 @@ export const FILE_PATTERNS = {
|
|
|
72
92
|
'**/*.{yaml,yml}', // YAML
|
|
73
93
|
'**/*.toml', // TOML
|
|
74
94
|
'**/*.{xml,xsl,xsd,wsdl,pom,csproj}', // XML
|
|
75
|
-
'**/*.{
|
|
95
|
+
'**/*.{tf,tfvars,hcl}', // Terraform / HCL
|
|
96
|
+
'**/*.{ini,cfg}', // INI / config
|
|
97
|
+
'**/*.properties', // Java properties
|
|
98
|
+
'**/*.{md,mdx,mdc,rst,txt,markdown}', // Documentation + Cursor rules
|
|
76
99
|
'**/*.{html,htm,xhtml,vue,svelte}', // Web markup/SFC
|
|
77
100
|
'**/*.{css,scss,sass,less}', // Stylesheets
|
|
78
101
|
'**/*.svg', // SVG
|
|
@@ -82,6 +105,15 @@ export const FILE_PATTERNS = {
|
|
|
82
105
|
'**/*.dockerfile', // Dockerfile alt extension
|
|
83
106
|
'**/Makefile', // Makefile
|
|
84
107
|
'**/*.mk', // Makefile includes
|
|
108
|
+
'**/*.cmake', // CMake modules
|
|
109
|
+
'**/*.gradle', // Gradle (Groovy DSL)
|
|
110
|
+
'**/*.ninja', // Ninja
|
|
111
|
+
'**/*.{bzl,star}', // Bazel / Starlark
|
|
112
|
+
'**/BUILD', '**/BUILD.bazel', // Bazel BUILD
|
|
113
|
+
'**/WORKSPACE', '**/WORKSPACE.bazel', // Bazel WORKSPACE
|
|
114
|
+
'**/meson.build', // Meson
|
|
115
|
+
'**/Earthfile', // Earthly
|
|
116
|
+
'**/justfile', '**/Justfile', // Just
|
|
85
117
|
// Project markers
|
|
86
118
|
'**/CLAUDE.md',
|
|
87
119
|
'**/AGENTS.md',
|
|
@@ -119,8 +119,72 @@ export const EXTENSION_MAP = {
|
|
|
119
119
|
// F# / VB (.NET additional)
|
|
120
120
|
// '.vb' omitted — no LANGUAGES.vb entry exists
|
|
121
121
|
|
|
122
|
+
// Julia
|
|
123
|
+
'.jl': 'julia',
|
|
124
|
+
|
|
125
|
+
// R — the lookup lowercases the key, so '.r'/'.rd'/'.rmd' also resolve the
|
|
126
|
+
// canonical uppercase on-disk forms (.R/.Rd/.Rmd). Keep keys lowercase only.
|
|
127
|
+
'.r': 'r', '.rd': 'r', '.rmd': 'r',
|
|
128
|
+
|
|
129
|
+
// OCaml (tree-sitter-ocaml ships in the bundle but is unwired → generic chunking)
|
|
130
|
+
'.ml': 'ocaml', '.mli': 'ocaml', '.mll': 'ocaml', '.mly': 'ocaml',
|
|
131
|
+
|
|
132
|
+
// TypeScript modules (CommonJS / ESM) — reuse the wired typescript grammar.
|
|
133
|
+
// Map to 'typescript' not 'tsx': .cts/.mts cannot contain JSX.
|
|
134
|
+
'.cts': 'typescript', '.mts': 'typescript',
|
|
135
|
+
|
|
136
|
+
// Other bundled-grammar languages (unwired → lossless generic chunking)
|
|
137
|
+
'.elm': 'elm',
|
|
138
|
+
'.sol': 'solidity',
|
|
139
|
+
'.res': 'rescript', '.resi': 'rescript',
|
|
140
|
+
'.ql': 'ql', '.qll': 'ql',
|
|
141
|
+
'.tla': 'tlaplus',
|
|
142
|
+
'.rdl': 'systemrdl',
|
|
143
|
+
'.el': 'elisp',
|
|
144
|
+
'.ejs': 'embedded_template',
|
|
145
|
+
|
|
146
|
+
// Functional / systems / scripting
|
|
147
|
+
'.hs': 'haskell', '.lhs': 'haskell',
|
|
148
|
+
'.erl': 'erlang', '.hrl': 'erlang',
|
|
149
|
+
'.cr': 'crystal',
|
|
150
|
+
'.vala': 'vala',
|
|
151
|
+
'.hx': 'haxe',
|
|
152
|
+
'.pas': 'pascal',
|
|
153
|
+
'.nix': 'nix',
|
|
154
|
+
'.pl': 'perl', '.pm': 'perl', '.pod': 'perl',
|
|
155
|
+
'.vim': 'vim',
|
|
156
|
+
'.tcl': 'tcl', '.tk': 'tcl',
|
|
157
|
+
'.zeek': 'zeek', '.bro': 'zeek',
|
|
158
|
+
|
|
159
|
+
// Scientific / legacy (lowercase keys cover the uppercase .F/.F90/.S forms)
|
|
160
|
+
'.f': 'fortran', '.for': 'fortran', '.f90': 'fortran', '.f95': 'fortran',
|
|
161
|
+
'.f03': 'fortran', '.f08': 'fortran',
|
|
162
|
+
'.cob': 'cobol', '.cbl': 'cobol',
|
|
163
|
+
'.asm': 'assembly', '.s': 'assembly',
|
|
164
|
+
|
|
165
|
+
// GPU shaders
|
|
166
|
+
'.glsl': 'glsl', '.vert': 'glsl', '.frag': 'glsl', '.comp': 'glsl',
|
|
167
|
+
'.geom': 'glsl', '.tesc': 'glsl', '.tese': 'glsl',
|
|
168
|
+
'.hlsl': 'hlsl', '.hlsli': 'hlsl',
|
|
169
|
+
'.metal': 'metal',
|
|
170
|
+
'.wgsl': 'wgsl',
|
|
171
|
+
'.shader': 'shaderlab',
|
|
172
|
+
'.cg': 'cg', '.cginc': 'cg',
|
|
173
|
+
|
|
174
|
+
// Web framework SFC — reuse the html SFC path (like .vue/.svelte)
|
|
175
|
+
'.astro': 'html',
|
|
176
|
+
|
|
177
|
+
// Infra / build / config DSLs
|
|
178
|
+
'.tf': 'hcl', '.tfvars': 'hcl', '.hcl': 'hcl',
|
|
179
|
+
'.ini': 'ini', '.cfg': 'ini',
|
|
180
|
+
'.properties': 'properties',
|
|
181
|
+
'.cmake': 'cmake',
|
|
182
|
+
'.gradle': 'gradle',
|
|
183
|
+
'.ninja': 'ninja',
|
|
184
|
+
'.bzl': 'starlark', '.star': 'starlark',
|
|
185
|
+
|
|
122
186
|
// Document formats (dispatched to DocumentChunker in ast-chunker.js)
|
|
123
|
-
'.md': 'markdown', '.mdx': 'markdown',
|
|
187
|
+
'.md': 'markdown', '.mdx': 'markdown', '.markdown': 'markdown',
|
|
124
188
|
'.rst': 'rst',
|
|
125
189
|
'.txt': 'plaintext',
|
|
126
190
|
};
|
|
@@ -130,4 +194,11 @@ export const FILENAME_MAP = {
|
|
|
130
194
|
Dockerfile: 'dockerfile',
|
|
131
195
|
Makefile: 'makefile',
|
|
132
196
|
GNUmakefile: 'makefile',
|
|
197
|
+
// Extensionless build / project files (mirrors the Dockerfile/Makefile pattern)
|
|
198
|
+
BUILD: 'starlark',
|
|
199
|
+
WORKSPACE: 'starlark',
|
|
200
|
+
'meson.build': 'meson',
|
|
201
|
+
Earthfile: 'earthfile',
|
|
202
|
+
justfile: 'just',
|
|
203
|
+
Justfile: 'just',
|
|
133
204
|
};
|
|
@@ -235,6 +235,95 @@ export const TOOLING_LANGUAGES = {
|
|
|
235
235
|
skipCallObjects: [],
|
|
236
236
|
},
|
|
237
237
|
},
|
|
238
|
+
// ─── Solidity ────────────────────────────────────────────────────────────────
|
|
239
|
+
// Real chunking is done by tree-sitter-solidity (GRAMMAR_MAP); these regex
|
|
240
|
+
// patterns are the fallback used only when tree-sitter is unavailable.
|
|
241
|
+
solidity: {
|
|
242
|
+
indentBased: false,
|
|
243
|
+
endKeyword: null,
|
|
244
|
+
comment: { line: "//", block: ["/*", "*/"] },
|
|
245
|
+
chunker: {
|
|
246
|
+
contract: /^\s*(?:abstract\s+)?contract\s+(\w+)/,
|
|
247
|
+
interface: /^\s*interface\s+(\w+)/,
|
|
248
|
+
library: /^\s*library\s+(\w+)/,
|
|
249
|
+
function: /^\s*function\s+(\w+)/,
|
|
250
|
+
struct: /^\s*struct\s+(\w+)/,
|
|
251
|
+
},
|
|
252
|
+
graph: {
|
|
253
|
+
entities: {
|
|
254
|
+
contract: /^\s*(?:abstract\s+)?contract\s+(\w+)/,
|
|
255
|
+
interface: /^\s*interface\s+(\w+)/,
|
|
256
|
+
library: /^\s*library\s+(\w+)/,
|
|
257
|
+
function: /^\s*function\s+(\w+)/,
|
|
258
|
+
},
|
|
259
|
+
relationships: {
|
|
260
|
+
import: /^\s*import\s+.*["']([^"']+)["']/,
|
|
261
|
+
inherit: /\bis\s+([A-Z]\w*)/,
|
|
262
|
+
},
|
|
263
|
+
skipCallObjects: ["require", "assert", "revert", "emit"],
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
// ─── OCaml ───────────────────────────────────────────────────────────────────
|
|
267
|
+
// tree-sitter-ocaml does the real chunking. OCaml has no line comment — only
|
|
268
|
+
// `(* … *)` blocks.
|
|
269
|
+
ocaml: {
|
|
270
|
+
indentBased: false,
|
|
271
|
+
endKeyword: null,
|
|
272
|
+
comment: { line: null, block: ["(*", "*)"] },
|
|
273
|
+
chunker: {
|
|
274
|
+
function: /^\s*let\s+(?:rec\s+)?(\w+)/,
|
|
275
|
+
type: /^\s*(?:and\s+)?type\s+(\w+)/,
|
|
276
|
+
module: /^\s*module\s+(\w+)/,
|
|
277
|
+
},
|
|
278
|
+
graph: {
|
|
279
|
+
entities: {
|
|
280
|
+
function: /^\s*let\s+(?:rec\s+)?(\w+)/,
|
|
281
|
+
type: /^\s*type\s+(\w+)/,
|
|
282
|
+
module: /^\s*module\s+(\w+)/,
|
|
283
|
+
},
|
|
284
|
+
relationships: { open: /^\s*open\s+([\w.]+)/ },
|
|
285
|
+
skipCallObjects: [],
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
// ─── ReScript ────────────────────────────────────────────────────────────────
|
|
289
|
+
rescript: {
|
|
290
|
+
indentBased: false,
|
|
291
|
+
endKeyword: null,
|
|
292
|
+
comment: { line: "//", block: ["/*", "*/"] },
|
|
293
|
+
chunker: {
|
|
294
|
+
function: /^\s*let\s+(\w+)/,
|
|
295
|
+
type: /^\s*type\s+(\w+)/,
|
|
296
|
+
module: /^\s*module\s+(\w+)/,
|
|
297
|
+
},
|
|
298
|
+
graph: {
|
|
299
|
+
entities: {
|
|
300
|
+
function: /^\s*let\s+(\w+)/,
|
|
301
|
+
type: /^\s*type\s+(\w+)/,
|
|
302
|
+
module: /^\s*module\s+(\w+)/,
|
|
303
|
+
},
|
|
304
|
+
relationships: { open: /^\s*open\s+(\w+)/ },
|
|
305
|
+
skipCallObjects: [],
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
// ─── TLA+ ────────────────────────────────────────────────────────────────────
|
|
309
|
+
// tree-sitter-tlaplus does the real chunking. Comments are `\* …` / `(* … *)`.
|
|
310
|
+
tlaplus: {
|
|
311
|
+
indentBased: false,
|
|
312
|
+
endKeyword: null,
|
|
313
|
+
comment: { line: "\\*", block: ["(*", "*)"] },
|
|
314
|
+
chunker: {
|
|
315
|
+
module: /^-{2,}\s*MODULE\s+(\w+)/,
|
|
316
|
+
operator: /^(\w+)\s*==/,
|
|
317
|
+
},
|
|
318
|
+
graph: {
|
|
319
|
+
entities: {
|
|
320
|
+
module: /^-{2,}\s*MODULE\s+(\w+)/,
|
|
321
|
+
operator: /^(\w+)\s*==/,
|
|
322
|
+
},
|
|
323
|
+
relationships: { extends: /^EXTENDS\s+([\w,\s]+)/ },
|
|
324
|
+
skipCallObjects: [],
|
|
325
|
+
},
|
|
326
|
+
},
|
|
238
327
|
};
|
|
239
328
|
|
|
240
329
|
export default TOOLING_LANGUAGES;
|
|
@@ -46,6 +46,14 @@ const GRAMMAR_MAP = {
|
|
|
46
46
|
// classes. Wiring tree-sitter-c-sharp puts C# on the same code path as
|
|
47
47
|
// the other 13 languages (cAST sibling-merge over a proper AST).
|
|
48
48
|
csharp: 'tree-sitter-c_sharp',
|
|
49
|
+
// Wired 2026-06 (v2.6.3) for first-class AST/cAST chunking. All four wasm
|
|
50
|
+
// grammars ship in tree-sitter-wasms and load on the installed web-tree-sitter
|
|
51
|
+
// ABI. (tree-sitter-elm / tree-sitter-ql also ship but are ABI 12/10 vs the
|
|
52
|
+
// required 13–15, so they stay on generic chunking.)
|
|
53
|
+
solidity: 'tree-sitter-solidity',
|
|
54
|
+
tlaplus: 'tree-sitter-tlaplus',
|
|
55
|
+
ocaml: 'tree-sitter-ocaml',
|
|
56
|
+
rescript: 'tree-sitter-rescript',
|
|
49
57
|
};
|
|
50
58
|
|
|
51
59
|
// Identifier node types — used to detect leaf-ident captures in extractSymbols()
|
|
@@ -56,6 +64,10 @@ const IDENT_TYPES = new Set([
|
|
|
56
64
|
'name', // PHP all identifiers
|
|
57
65
|
'simple_identifier', // Kotlin functions, Swift functions
|
|
58
66
|
'namespace_identifier', // C++ namespace names
|
|
67
|
+
// OCaml — names live in *_binding children (see _extractNodeName drill)
|
|
68
|
+
'value_name', 'type_constructor', 'module_name',
|
|
69
|
+
// ReScript — value/module binding names (type_identifier already covered)
|
|
70
|
+
'value_identifier', 'module_identifier',
|
|
59
71
|
]);
|
|
60
72
|
|
|
61
73
|
// AST node types that represent meaningful chunk boundaries
|
|
@@ -156,6 +168,25 @@ const LANG_EXTRA_BOUNDARY_TYPES = {
|
|
|
156
168
|
'local_function_statement',
|
|
157
169
|
'event_declaration', 'event_field_declaration',
|
|
158
170
|
]),
|
|
171
|
+
// Solidity (tree-sitter-solidity). `function_definition` is already a global
|
|
172
|
+
// boundary; these are the contract-level declarations the grammar emits, all
|
|
173
|
+
// carrying a `name: (identifier)` field so _extractNodeName resolves them.
|
|
174
|
+
solidity: new Set([
|
|
175
|
+
'contract_declaration', 'interface_declaration', 'library_declaration',
|
|
176
|
+
'struct_declaration', 'enum_declaration', 'event_definition',
|
|
177
|
+
'modifier_definition', 'constructor_definition', 'error_declaration',
|
|
178
|
+
]),
|
|
179
|
+
// TLA+ (tree-sitter-tlaplus). `module` is already global; operator_definition
|
|
180
|
+
// (`Foo == ...`) is the unit of definition, name via `name: (identifier)`.
|
|
181
|
+
tlaplus: new Set(['operator_definition']),
|
|
182
|
+
// OCaml (tree-sitter-ocaml). `type_definition` is already global; these wrap a
|
|
183
|
+
// *_binding whose name (value_name/type_constructor/module_name) is recovered
|
|
184
|
+
// by the _extractNodeName binding-wrapper drill. value_definition is top-level
|
|
185
|
+
// only (local `let … in` is a let_expression), so this doesn't over-chunk.
|
|
186
|
+
ocaml: new Set(['value_definition', 'module_definition', 'exception_definition']),
|
|
187
|
+
// ReScript (tree-sitter-rescript). `type_declaration` is already global; the
|
|
188
|
+
// let/module declarations wrap a *_binding handled by the same drill.
|
|
189
|
+
rescript: new Set(['let_declaration', 'module_declaration']),
|
|
159
190
|
};
|
|
160
191
|
|
|
161
192
|
// Per-language EXCLUSIONS from BOUNDARY_TYPES. Removes node-type names that
|
|
@@ -283,6 +314,37 @@ const NODE_TYPE_MAP = {
|
|
|
283
314
|
'local_function_statement': 'function',
|
|
284
315
|
'event_declaration': 'property',
|
|
285
316
|
'event_field_declaration': 'field',
|
|
317
|
+
// Solidity (tree-sitter-solidity) — grammar-unique node names, so these are
|
|
318
|
+
// null-ops for every other language's chunking.
|
|
319
|
+
'contract_declaration': 'class',
|
|
320
|
+
'library_declaration': 'class',
|
|
321
|
+
'event_definition': 'event',
|
|
322
|
+
'modifier_definition': 'function',
|
|
323
|
+
'constructor_definition': 'method',
|
|
324
|
+
'error_declaration': 'type',
|
|
325
|
+
// TLA+
|
|
326
|
+
'operator_definition': 'function',
|
|
327
|
+
// OCaml
|
|
328
|
+
'value_definition': 'function',
|
|
329
|
+
'module_definition': 'module',
|
|
330
|
+
'exception_definition': 'class',
|
|
331
|
+
// ReScript
|
|
332
|
+
'let_declaration': 'function',
|
|
333
|
+
'module_declaration': 'module',
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
// OCaml / ReScript boundary node -> the `*_binding` child that carries the name.
|
|
337
|
+
// Consulted only by _extractNodeName; the keys are grammar-unique node types.
|
|
338
|
+
const OCAML_RESCRIPT_BINDING_WRAPPERS = {
|
|
339
|
+
// OCaml
|
|
340
|
+
value_definition: 'let_binding',
|
|
341
|
+
module_definition: 'module_binding',
|
|
342
|
+
// ReScript
|
|
343
|
+
let_declaration: 'let_binding',
|
|
344
|
+
module_declaration: 'module_binding',
|
|
345
|
+
// Shared (already a global boundary; name nested in *_binding for both langs)
|
|
346
|
+
type_definition: 'type_binding',
|
|
347
|
+
type_declaration: 'type_binding',
|
|
286
348
|
};
|
|
287
349
|
|
|
288
350
|
// Standard tags.scm query patterns for symbol extraction
|
|
@@ -534,6 +596,34 @@ const TAGS_QUERIES = {
|
|
|
534
596
|
(field_declaration (variable_declaration (variable_declarator name: (identifier) @field.definition)))
|
|
535
597
|
(local_function_statement name: (identifier) @function.definition)
|
|
536
598
|
`,
|
|
599
|
+
// Solidity (tree-sitter-solidity) — every declaration carries name: (identifier).
|
|
600
|
+
solidity: `
|
|
601
|
+
(contract_declaration name: (identifier) @class.definition)
|
|
602
|
+
(interface_declaration name: (identifier) @interface.definition)
|
|
603
|
+
(library_declaration name: (identifier) @class.definition)
|
|
604
|
+
(struct_declaration name: (identifier) @struct.definition)
|
|
605
|
+
(enum_declaration name: (identifier) @enum.definition)
|
|
606
|
+
(function_definition name: (identifier) @function.definition)
|
|
607
|
+
(modifier_definition name: (identifier) @function.definition)
|
|
608
|
+
(event_definition name: (identifier) @function.definition)
|
|
609
|
+
`,
|
|
610
|
+
// TLA+ (tree-sitter-tlaplus)
|
|
611
|
+
tlaplus: `
|
|
612
|
+
(module name: (identifier) @namespace.definition)
|
|
613
|
+
(operator_definition name: (identifier) @function.definition)
|
|
614
|
+
`,
|
|
615
|
+
// OCaml (tree-sitter-ocaml) — names nested in the *_binding child.
|
|
616
|
+
ocaml: `
|
|
617
|
+
(value_definition (let_binding (value_name) @function.definition))
|
|
618
|
+
(type_definition (type_binding (type_constructor) @type.definition))
|
|
619
|
+
(module_definition (module_binding (module_name) @namespace.definition))
|
|
620
|
+
`,
|
|
621
|
+
// ReScript (tree-sitter-rescript) — names nested in the *_binding child.
|
|
622
|
+
rescript: `
|
|
623
|
+
(let_declaration (let_binding (value_identifier) @function.definition))
|
|
624
|
+
(type_declaration (type_binding (type_identifier) @type.definition))
|
|
625
|
+
(module_declaration (module_binding (module_identifier) @namespace.definition))
|
|
626
|
+
`,
|
|
537
627
|
};
|
|
538
628
|
|
|
539
629
|
// Names that tree-sitter-c / tree-sitter-cpp sometimes emit as the `name:`
|
|
@@ -1361,6 +1451,24 @@ export class TreeSitterProvider {
|
|
|
1361
1451
|
}
|
|
1362
1452
|
}
|
|
1363
1453
|
|
|
1454
|
+
// OCaml / ReScript — the definition's name lives one level down in the
|
|
1455
|
+
// grammar's `*_binding` child (value_definition → let_binding → value_name;
|
|
1456
|
+
// type_definition → type_binding → type_constructor/type_identifier;
|
|
1457
|
+
// module_definition → module_binding → module_name/module_identifier). The
|
|
1458
|
+
// wrapper node-type strings below are unique to tree-sitter-ocaml/rescript,
|
|
1459
|
+
// so this branch is a null-op for every other grammar.
|
|
1460
|
+
const BINDING_WRAPPER = OCAML_RESCRIPT_BINDING_WRAPPERS[node.type];
|
|
1461
|
+
if (BINDING_WRAPPER) {
|
|
1462
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
1463
|
+
const binding = node.child(i);
|
|
1464
|
+
if (binding.type !== BINDING_WRAPPER) continue;
|
|
1465
|
+
for (let j = 0; j < binding.childCount; j++) {
|
|
1466
|
+
const nm = binding.child(j);
|
|
1467
|
+
if (IDENT_TYPES.has(nm.type)) return nm.text;
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1364
1472
|
// Fallback: look for identifier-type children (uses IDENT_TYPES set).
|
|
1365
1473
|
// Visibility-keyword stoplist: tree-sitter-ruby parses bare `private`,
|
|
1366
1474
|
// `protected`, `public` (with no args) as standalone `identifier`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sweet-search",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.4",
|
|
4
4
|
"description": "Sweet Search - SOTA Hybrid Code Search Engine with WASM CatBoost Query Router, Semantic/Lexical/Structural Search, and Multilingual Support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "core/search/sweet-search.js",
|
|
@@ -167,13 +167,13 @@
|
|
|
167
167
|
"vitest": "^4.0.16"
|
|
168
168
|
},
|
|
169
169
|
"optionalDependencies": {
|
|
170
|
-
"@sweet-search/native-darwin-arm64": "2.6.
|
|
171
|
-
"@sweet-search/native-darwin-x64": "2.6.
|
|
172
|
-
"@sweet-search/native-linux-arm64-gnu": "2.6.
|
|
173
|
-
"@sweet-search/native-linux-arm64-gnu-cuda": "2.6.
|
|
174
|
-
"@sweet-search/native-linux-x64-gnu": "2.6.
|
|
175
|
-
"@sweet-search/native-linux-x64-gnu-cuda": "2.6.
|
|
176
|
-
"@sweet-search/bg-priority": "2.6.
|
|
170
|
+
"@sweet-search/native-darwin-arm64": "2.6.4",
|
|
171
|
+
"@sweet-search/native-darwin-x64": "2.6.4",
|
|
172
|
+
"@sweet-search/native-linux-arm64-gnu": "2.6.4",
|
|
173
|
+
"@sweet-search/native-linux-arm64-gnu-cuda": "2.6.4",
|
|
174
|
+
"@sweet-search/native-linux-x64-gnu": "2.6.4",
|
|
175
|
+
"@sweet-search/native-linux-x64-gnu-cuda": "2.6.4",
|
|
176
|
+
"@sweet-search/bg-priority": "2.6.4"
|
|
177
177
|
},
|
|
178
178
|
"engines": {
|
|
179
179
|
"node": ">=18.0.0"
|