sweet-search 2.6.4 → 2.6.5
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.
- package/core/infrastructure/constants.js +31 -11
- package/package.json +8 -8
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* Extracted to prevent drift between graph-search.js and sweet-search.js
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { EXTENSION_MAP } from './language-patterns/maps.js';
|
|
7
|
+
|
|
6
8
|
export const SYMBOL_KIND_WEIGHTS = {
|
|
7
9
|
class: 1.0,
|
|
8
10
|
interface: 0.95,
|
|
@@ -26,25 +28,43 @@ export const DEFINITION_TYPES = new Set([
|
|
|
26
28
|
]);
|
|
27
29
|
|
|
28
30
|
/**
|
|
29
|
-
* Canonical set of code file extensions recognized by sweet-search
|
|
30
|
-
*
|
|
31
|
-
*
|
|
31
|
+
* Canonical set of code file extensions recognized by sweet-search's
|
|
32
|
+
* grep/pattern path — the sparse-gram literal index, native-grep extension
|
|
33
|
+
* filter, ripgrep `--type-add code` fallback, and `isRipgrepCodePath`.
|
|
34
|
+
*
|
|
35
|
+
* DERIVED from EXTENSION_MAP (the single source of truth for which extensions
|
|
36
|
+
* sweet-search indexes) so ss-grep coverage can NEVER drift behind newly-added
|
|
37
|
+
* languages. This drift previously dropped Solidity, .cts/.mts, .cljc/.cljs/.edn,
|
|
38
|
+
* .mli, .rd/.rmd, shaders, build DSLs, etc. from ss-grep even though they were
|
|
39
|
+
* discovered + embedded (so ss-search worked but ss-grep silently returned
|
|
40
|
+
* nothing). Keys are stored bare + lowercase (no leading dot) to match
|
|
41
|
+
* `path.extname(f).slice(1).toLowerCase()` at the call sites.
|
|
42
|
+
*
|
|
43
|
+
* Pure document formats (Markdown/reStructuredText/plaintext) are intentionally
|
|
44
|
+
* EXCLUDED — they go through DocumentChunker and are not part of the grep
|
|
45
|
+
* code-path (isRipgrepCodePath('README.md') must stay false, and sparse-gram
|
|
46
|
+
* candidate lists drop doc files). Config/markup/style formats (json/yaml/xml/
|
|
47
|
+
* html/css/ini/…) stay in, matching the historical set.
|
|
48
|
+
*
|
|
49
|
+
* Plus a few historically grep-able languages that have no EXTENSION_MAP entry
|
|
50
|
+
* (no chunker grammar): Ada, D, V.
|
|
32
51
|
*/
|
|
52
|
+
const DOC_FORMAT_LANGUAGE_IDS = new Set(['markdown', 'rst', 'plaintext']);
|
|
53
|
+
const LEGACY_EXTRA_CODE_EXTENSIONS = ['ada', 'd', 'v'];
|
|
33
54
|
export const CODE_FILE_EXTENSIONS = new Set([
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
'json', 'toml', 'xml', 'html', 'css', 'scss', 'sass', 'less', 'svelte',
|
|
39
|
-
'vue', 'astro', 'mdx',
|
|
55
|
+
...Object.entries(EXTENSION_MAP)
|
|
56
|
+
.filter(([, id]) => !DOC_FORMAT_LANGUAGE_IDS.has(id))
|
|
57
|
+
.map(([ext]) => ext.replace(/^\./, '').toLowerCase()),
|
|
58
|
+
...LEGACY_EXTRA_CODE_EXTENSIONS,
|
|
40
59
|
]);
|
|
41
60
|
|
|
42
61
|
/**
|
|
43
62
|
* Ripgrep type definition glob matching CODE_FILE_EXTENSIONS.
|
|
44
|
-
* Used with --type-add to define a custom 'code' type for ripgrep.
|
|
63
|
+
* Used with --type-add to define a custom 'code' type for ripgrep. Derived from
|
|
64
|
+
* the same set so it stays in lockstep.
|
|
45
65
|
*/
|
|
46
66
|
export const RIPGREP_CODE_TYPE_GLOB =
|
|
47
|
-
|
|
67
|
+
`code:*.{${Array.from(CODE_FILE_EXTENSIONS).join(',')}}`;
|
|
48
68
|
|
|
49
69
|
/**
|
|
50
70
|
* Sparse gram symbol type bitmasks.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sweet-search",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.5",
|
|
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.5",
|
|
171
|
+
"@sweet-search/native-darwin-x64": "2.6.5",
|
|
172
|
+
"@sweet-search/native-linux-arm64-gnu": "2.6.5",
|
|
173
|
+
"@sweet-search/native-linux-arm64-gnu-cuda": "2.6.5",
|
|
174
|
+
"@sweet-search/native-linux-x64-gnu": "2.6.5",
|
|
175
|
+
"@sweet-search/native-linux-x64-gnu-cuda": "2.6.5",
|
|
176
|
+
"@sweet-search/bg-priority": "2.6.5"
|
|
177
177
|
},
|
|
178
178
|
"engines": {
|
|
179
179
|
"node": ">=18.0.0"
|