sweet-search 2.6.0 → 2.6.1
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.
|
@@ -349,7 +349,11 @@ export class ASTChunker {
|
|
|
349
349
|
// chunker uses tree-sitter-cpp instead of tree-sitter-c.
|
|
350
350
|
const langInfo = resolveLanguage(filePath, content);
|
|
351
351
|
if (!langInfo || !langInfo.chunker) {
|
|
352
|
-
|
|
352
|
+
// Mapped-but-chunkerless languages (e.g. Clojure: no tree-sitter grammar,
|
|
353
|
+
// and paren-delimited forms don't fit the brace/indent/endKeyword parsers)
|
|
354
|
+
// fall back to lossless generic windowing but keep their resolved language
|
|
355
|
+
// id so chunks are tagged 'clojure' rather than generic 'text'.
|
|
356
|
+
return this.parseGenericFile(filePath, content, langInfo?.id || 'text');
|
|
353
357
|
}
|
|
354
358
|
|
|
355
359
|
// Try tree-sitter WASM first for supported languages
|
|
@@ -909,7 +913,7 @@ export class ASTChunker {
|
|
|
909
913
|
return subChunks;
|
|
910
914
|
}
|
|
911
915
|
|
|
912
|
-
parseGenericFile(filePath, content) {
|
|
916
|
+
parseGenericFile(filePath, content, language = 'text') {
|
|
913
917
|
const lines = content.split('\n');
|
|
914
918
|
const chunks = [];
|
|
915
919
|
const CHUNK_SIZE = 50;
|
|
@@ -921,7 +925,7 @@ export class ASTChunker {
|
|
|
921
925
|
const chunkContent = lines.slice(start, end).join('\n');
|
|
922
926
|
|
|
923
927
|
if (chunkContent.trim().length > 20) {
|
|
924
|
-
chunks.push(this.buildChunk(chunkContent, filePath,
|
|
928
|
+
chunks.push(this.buildChunk(chunkContent, filePath, language, 'code', 'unknown', start, end - 1));
|
|
925
929
|
}
|
|
926
930
|
|
|
927
931
|
start = end - OVERLAP;
|
|
@@ -53,6 +53,7 @@ export const FILE_PATTERNS = {
|
|
|
53
53
|
// Source code (all major languages)
|
|
54
54
|
'**/*.{js,jsx,ts,tsx,mjs,cjs}', // JavaScript/TypeScript
|
|
55
55
|
'**/*.{java,kt,kts,scala,groovy}', // JVM
|
|
56
|
+
'**/*.{clj,cljc,cljs,edn}', // Clojure / ClojureScript / EDN
|
|
56
57
|
'**/*.{py,pyi}', // Python
|
|
57
58
|
'**/*.go', // Go
|
|
58
59
|
'**/*.rs', // Rust
|
|
@@ -42,6 +42,15 @@ export const EXTENSION_MAP = {
|
|
|
42
42
|
// Scala
|
|
43
43
|
'.scala': 'scala',
|
|
44
44
|
|
|
45
|
+
// Clojure / ClojureScript / EDN
|
|
46
|
+
// No tree-sitter-clojure grammar ships in the bundle and the brace-based
|
|
47
|
+
// regex chunker would fragment paren-delimited Lisp forms (and drop sub-30-char
|
|
48
|
+
// defns via MIN_CONTENT_LENGTH), so there is intentionally no LANGUAGES.clojure
|
|
49
|
+
// entry — getLanguageByExtension returns the chunker-less fallback and
|
|
50
|
+
// ast-chunker routes these through parseGenericFile (lossless 50-line windows),
|
|
51
|
+
// tagged with this 'clojure' language id rather than generic 'text'.
|
|
52
|
+
'.clj': 'clojure', '.cljc': 'clojure', '.cljs': 'clojure', '.edn': 'clojure',
|
|
53
|
+
|
|
45
54
|
// Dart
|
|
46
55
|
'.dart': 'dart',
|
|
47
56
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sweet-search",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.1",
|
|
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.1",
|
|
171
|
+
"@sweet-search/native-darwin-x64": "2.6.1",
|
|
172
|
+
"@sweet-search/native-linux-arm64-gnu": "2.6.1",
|
|
173
|
+
"@sweet-search/native-linux-arm64-gnu-cuda": "2.6.1",
|
|
174
|
+
"@sweet-search/native-linux-x64-gnu": "2.6.1",
|
|
175
|
+
"@sweet-search/native-linux-x64-gnu-cuda": "2.6.1",
|
|
176
|
+
"@sweet-search/bg-priority": "2.6.1"
|
|
177
177
|
},
|
|
178
178
|
"engines": {
|
|
179
179
|
"node": ">=18.0.0"
|