token-goat 2.9.19 → 2.9.21
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/README.md +3 -1
- package/dist/{token-goat-chunk-JNIFSVWM.mjs → token-goat-chunk-2ZHD3XCD.mjs} +5 -1
- package/dist/{token-goat-chunk-P46RTOAQ.mjs → token-goat-chunk-4IIU3GNS.mjs} +10 -7
- package/dist/{token-goat-chunk-2GTB5RBZ.mjs → token-goat-chunk-4V4OZHHV.mjs} +11 -271
- package/dist/token-goat-chunk-64OEF3UN.mjs +128 -0
- package/dist/{token-goat-chunk-AVRD7SBO.mjs → token-goat-chunk-6AQLZMCO.mjs} +270 -29
- package/dist/{token-goat-chunk-LACH3WKS.mjs → token-goat-chunk-BIEDTF6V.mjs} +3 -3
- package/dist/{token-goat-chunk-PIAESKVU.mjs → token-goat-chunk-BKHJRFDE.mjs} +568 -429
- package/dist/token-goat-chunk-CAHN4QU7.mjs +26 -0
- package/dist/{token-goat-chunk-MU6I4IDI.mjs → token-goat-chunk-CMAJGP3E.mjs} +11 -7
- package/dist/token-goat-chunk-CMHBTXMY.mjs +41 -0
- package/dist/{token-goat-chunk-HPMMLV37.mjs → token-goat-chunk-CZ5ZFJSN.mjs} +256 -341
- package/dist/{token-goat-chunk-7DGTVBWP.mjs → token-goat-chunk-DDP64XR7.mjs} +159 -1863
- package/dist/{token-goat-chunk-FX5DHKGF.mjs → token-goat-chunk-DISVHOW6.mjs} +4 -4
- package/dist/{token-goat-chunk-L2UOJBV4.mjs → token-goat-chunk-FZN77SZD.mjs} +27 -19
- package/dist/{token-goat-chunk-DA6TIDLI.mjs → token-goat-chunk-GO7OWONJ.mjs} +18 -13
- package/dist/{token-goat-chunk-EP7TCWHM.mjs → token-goat-chunk-IAMIQLCV.mjs} +83 -66
- package/dist/{token-goat-chunk-NJKNAC37.mjs → token-goat-chunk-IJUHQX2M.mjs} +1 -1
- package/dist/token-goat-chunk-KQI24O4B.mjs +292 -0
- package/dist/{token-goat-chunk-GYC34EGE.mjs → token-goat-chunk-KRPJIXCT.mjs} +2 -2
- package/dist/token-goat-chunk-KVAXTA2W.mjs +198 -0
- package/dist/{token-goat-chunk-FJZ5MZK7.mjs → token-goat-chunk-LK3YOKDF.mjs} +2 -2
- package/dist/token-goat-chunk-M43UJVYQ.mjs +1816 -0
- package/dist/{token-goat-chunk-SOKAPOOC.mjs → token-goat-chunk-M6CDVASA.mjs} +46 -47
- package/dist/token-goat-chunk-MECDAPXB.mjs +1989 -0
- package/dist/token-goat-chunk-MEKVJZUN.mjs +324 -0
- package/dist/token-goat-chunk-MQACN7VG.mjs +1379 -0
- package/dist/{token-goat-chunk-3W5P673V.mjs → token-goat-chunk-MZQORUX5.mjs} +1 -1
- package/dist/{token-goat-chunk-DHIXE6GV.mjs → token-goat-chunk-ORRDWKLA.mjs} +1 -1
- package/dist/{token-goat-chunk-F24NE3FO.mjs → token-goat-chunk-PCR43MCM.mjs} +2 -2
- package/dist/token-goat-chunk-PDYQA3AP.mjs +248 -0
- package/dist/{token-goat-chunk-S7RFIX4Y.mjs → token-goat-chunk-PHDNWISV.mjs} +45 -14
- package/dist/token-goat-chunk-PPYZS7TI.mjs +304 -0
- package/dist/{token-goat-chunk-BTKDZW7F.mjs → token-goat-chunk-QTIRVK3M.mjs} +1 -1
- package/dist/{token-goat-chunk-62VJ47WN.mjs → token-goat-chunk-QUM3UNWS.mjs} +5 -5
- package/dist/{token-goat-chunk-KWM6KBPA.mjs → token-goat-chunk-SHV6QQAS.mjs} +1 -1
- package/dist/{token-goat-chunk-FQYMZASI.mjs → token-goat-chunk-SMUYPBF5.mjs} +796 -4464
- package/dist/{token-goat-chunk-ZGQXRYKE.mjs → token-goat-chunk-TGBSMHPM.mjs} +1 -1
- package/dist/{token-goat-chunk-EXLLLIC3.mjs → token-goat-chunk-VXKT3W4C.mjs} +3 -3
- package/dist/{token-goat-chunk-WKO5TVNA.mjs → token-goat-chunk-XJUPKJF5.mjs} +544 -576
- package/dist/{token-goat-chunk-IBTFGZBX.mjs → token-goat-chunk-XQSSPX3X.mjs} +2 -2
- package/dist/{token-goat-chunk-VJQBYSXG.mjs → token-goat-chunk-ZJWPJL7O.mjs} +3 -3
- package/dist/token-goat-hook.mjs +17 -11
- package/dist/token-goat.core.mjs +27 -19
- package/docs/C4_RUNTIME_ARCHITECTURE.md +1 -1
- package/docs/cli.md +13 -12
- package/docs/install.md +1 -1
- package/docs/security.md +2 -2
- package/package.json +3 -2
- package/dist/token-goat-chunk-NYFYIRG3.mjs +0 -35
|
@@ -25,11 +25,11 @@ import {
|
|
|
25
25
|
extractSwift,
|
|
26
26
|
extractThrift,
|
|
27
27
|
extractWgsl
|
|
28
|
-
} from "./token-goat-chunk-
|
|
28
|
+
} from "./token-goat-chunk-IJUHQX2M.mjs";
|
|
29
29
|
import {
|
|
30
30
|
extractShellBannerHeading
|
|
31
|
-
} from "./token-goat-chunk-
|
|
32
|
-
import "./token-goat-chunk-
|
|
31
|
+
} from "./token-goat-chunk-IAMIQLCV.mjs";
|
|
32
|
+
import "./token-goat-chunk-XQSSPX3X.mjs";
|
|
33
33
|
import {
|
|
34
34
|
GENERIC_CLAUSE,
|
|
35
35
|
assignBraceBlockSpans,
|
|
@@ -58,15 +58,15 @@ import {
|
|
|
58
58
|
stripMultilineStringSpan,
|
|
59
59
|
stripStringLiterals,
|
|
60
60
|
stripXmlComments
|
|
61
|
-
} from "./token-goat-chunk-
|
|
62
|
-
import "./token-goat-chunk-
|
|
61
|
+
} from "./token-goat-chunk-2ZHD3XCD.mjs";
|
|
62
|
+
import "./token-goat-chunk-M6CDVASA.mjs";
|
|
63
63
|
import "./token-goat-chunk-EEIDFMEM.mjs";
|
|
64
64
|
import "./token-goat-chunk-OSUFN2FV.mjs";
|
|
65
65
|
import {
|
|
66
66
|
countContentLines,
|
|
67
67
|
escapeRegExp,
|
|
68
68
|
pushAll
|
|
69
|
-
} from "./token-goat-chunk-
|
|
69
|
+
} from "./token-goat-chunk-TGBSMHPM.mjs";
|
|
70
70
|
import "./token-goat-chunk-NMTKNYGF.mjs";
|
|
71
71
|
import "./token-goat-chunk-Y4AFKTHK.mjs";
|
|
72
72
|
import "./token-goat-chunk-GMOUBOX4.mjs";
|
|
@@ -2459,6 +2459,18 @@ var TYPE_BODY_RE = makeCreateRe("TYPE\\s+BODY", `(?:OR\\s+REPLACE\\s+)?${EDITION
|
|
|
2459
2459
|
var PACKAGE_RE = makeCreateRe("PACKAGE(?!\\s+BODY\\b)", `(?:OR\\s+REPLACE\\s+)?${EDITIONING}`);
|
|
2460
2460
|
var PACKAGE_BODY_RE = makeCreateRe("PACKAGE\\s+BODY", `(?:OR\\s+REPLACE\\s+)?${EDITIONING}`);
|
|
2461
2461
|
var SCHEMA_RE3 = makeCreateRe("SCHEMA");
|
|
2462
|
+
var MACRO_RE = makeCreateRe("MACRO", `${OR_REPLACE}(?:TEMP(?:ORARY)?\\s+)?`);
|
|
2463
|
+
var SECRET_RE = makeCreateRe("SECRET", `${OR_REPLACE}(?:PERSISTENT\\s+)?`);
|
|
2464
|
+
var EXTENSION_RE2 = makeCreateRe("EXTENSION");
|
|
2465
|
+
var DOMAIN_RE = makeCreateRe("DOMAIN");
|
|
2466
|
+
var AGGREGATE_RE = makeCreateRe("AGGREGATE", OR_REPLACE);
|
|
2467
|
+
var POLICY_RE = makeCreateRe("POLICY");
|
|
2468
|
+
var RULE_RE = makeCreateRe("RULE", OR_REPLACE);
|
|
2469
|
+
var OPERATOR_RE2 = makeCreateRe("OPERATOR(?!\\s+(?:CLASS|FAMILY)\\b)", OR_REPLACE);
|
|
2470
|
+
var SYNONYM_RE = makeCreateRe("SYNONYM", `${OR_REPLACE}(?:PUBLIC\\s+)?`);
|
|
2471
|
+
var DATABASE_LINK_RE = makeCreateRe("DATABASE\\s+LINK", "(?:PUBLIC\\s+)?");
|
|
2472
|
+
var CLUSTER_RE = makeCreateRe("CLUSTER");
|
|
2473
|
+
var CONTEXT_RE = makeCreateRe("CONTEXT", `${OR_REPLACE}`);
|
|
2462
2474
|
var PATTERNS = [
|
|
2463
2475
|
[TABLE_RE, "sql_table"],
|
|
2464
2476
|
[VIEW_RE, "sql_view"],
|
|
@@ -2472,7 +2484,19 @@ var PATTERNS = [
|
|
|
2472
2484
|
[PACKAGE_RE, "sql_package"],
|
|
2473
2485
|
[PACKAGE_BODY_RE, "sql_package_body"],
|
|
2474
2486
|
[SCHEMA_RE3, "sql_schema"],
|
|
2475
|
-
[SEQUENCE_RE, "sql_sequence"]
|
|
2487
|
+
[SEQUENCE_RE, "sql_sequence"],
|
|
2488
|
+
[MACRO_RE, "sql_macro"],
|
|
2489
|
+
[SECRET_RE, "sql_secret"],
|
|
2490
|
+
[EXTENSION_RE2, "sql_extension"],
|
|
2491
|
+
[DOMAIN_RE, "sql_domain"],
|
|
2492
|
+
[AGGREGATE_RE, "sql_aggregate"],
|
|
2493
|
+
[POLICY_RE, "sql_policy"],
|
|
2494
|
+
[RULE_RE, "sql_rule"],
|
|
2495
|
+
[OPERATOR_RE2, "sql_operator"],
|
|
2496
|
+
[SYNONYM_RE, "sql_synonym"],
|
|
2497
|
+
[DATABASE_LINK_RE, "sql_database_link"],
|
|
2498
|
+
[CLUSTER_RE, "sql_cluster"],
|
|
2499
|
+
[CONTEXT_RE, "sql_context"]
|
|
2476
2500
|
];
|
|
2477
2501
|
var PLSQL_UNIT_KINDS = /* @__PURE__ */ new Set(["sql_package", "sql_package_body", "sql_type_body", "sql_procedure", "sql_function", "sql_trigger"]);
|
|
2478
2502
|
var PLSQL_CONTAINER_KINDS = /* @__PURE__ */ new Set(["sql_package", "sql_package_body", "sql_type_body"]);
|
|
@@ -2805,6 +2829,221 @@ function extractSql(content, filePath) {
|
|
|
2805
2829
|
return [...pinned, ...plsql.children].sort((a, b) => a.lineStart - b.lineStart);
|
|
2806
2830
|
}
|
|
2807
2831
|
|
|
2832
|
+
// src/languages/nginx.ts
|
|
2833
|
+
init_define_import_meta_env();
|
|
2834
|
+
var NGINX_BLOCK_START_RE = /^(?:([a-zA-Z0-9_]+)[ \t]+)?(http|events|stream|server|upstream|location)(?:[ \t]+([^{;\s](?:[^{};]*[^{};\s])?))?[ \t]*\{/;
|
|
2835
|
+
var SERVER_NAME_RE = /^\s*server_name[ \t]+([^\s;][^;]*);/;
|
|
2836
|
+
var LISTEN_RE = /^\s*listen[ \t]+([^\s;][^;]*);/;
|
|
2837
|
+
function extractNginx(content, filePath) {
|
|
2838
|
+
const lines = content.split("\n");
|
|
2839
|
+
const symbols = [];
|
|
2840
|
+
let braceDepth = 0;
|
|
2841
|
+
const blockStack = [];
|
|
2842
|
+
for (let i = 0; i < lines.length; i++) {
|
|
2843
|
+
const rawLine = lines[i] ?? "";
|
|
2844
|
+
const commentIdx = rawLine.indexOf("#");
|
|
2845
|
+
const lineWithoutComment = commentIdx >= 0 ? rawLine.slice(0, commentIdx) : rawLine;
|
|
2846
|
+
const trimmed = lineWithoutComment.trim();
|
|
2847
|
+
if (!trimmed) {
|
|
2848
|
+
continue;
|
|
2849
|
+
}
|
|
2850
|
+
const match = NGINX_BLOCK_START_RE.exec(trimmed);
|
|
2851
|
+
if (match) {
|
|
2852
|
+
const keyword = match[2] ?? "";
|
|
2853
|
+
const arg = match[3]?.trim() ?? "";
|
|
2854
|
+
let symbolName = keyword;
|
|
2855
|
+
const symbolKind = `nginx_${keyword}`;
|
|
2856
|
+
if (keyword === "upstream" && arg) {
|
|
2857
|
+
symbolName = `upstream ${arg}`;
|
|
2858
|
+
} else if (keyword === "location" && arg) {
|
|
2859
|
+
symbolName = `location ${arg}`;
|
|
2860
|
+
} else if (keyword === "server") {
|
|
2861
|
+
let label = "";
|
|
2862
|
+
let lookaheadBraces = 0;
|
|
2863
|
+
for (let j = i; j < Math.min(i + 40, lines.length); j++) {
|
|
2864
|
+
const lRaw = lines[j] ?? "";
|
|
2865
|
+
const lClean = (lRaw.indexOf("#") >= 0 ? lRaw.slice(0, lRaw.indexOf("#")) : lRaw).trim();
|
|
2866
|
+
for (const char of lClean) {
|
|
2867
|
+
if (char === "{") lookaheadBraces++;
|
|
2868
|
+
if (char === "}") lookaheadBraces--;
|
|
2869
|
+
}
|
|
2870
|
+
if (lookaheadBraces === 1) {
|
|
2871
|
+
const snMatch = SERVER_NAME_RE.exec(lRaw);
|
|
2872
|
+
if (snMatch && snMatch[1]) {
|
|
2873
|
+
const first = snMatch[1].trim().split(/\s+/)[0];
|
|
2874
|
+
if (first) {
|
|
2875
|
+
label = first;
|
|
2876
|
+
break;
|
|
2877
|
+
}
|
|
2878
|
+
}
|
|
2879
|
+
if (!label) {
|
|
2880
|
+
const listenMatch = LISTEN_RE.exec(lRaw);
|
|
2881
|
+
if (listenMatch && listenMatch[1]) {
|
|
2882
|
+
label = listenMatch[1].trim();
|
|
2883
|
+
}
|
|
2884
|
+
}
|
|
2885
|
+
}
|
|
2886
|
+
if (lookaheadBraces <= 0 && j > i) break;
|
|
2887
|
+
}
|
|
2888
|
+
symbolName = label ? `server (${label})` : "server";
|
|
2889
|
+
}
|
|
2890
|
+
blockStack.push({
|
|
2891
|
+
name: symbolName,
|
|
2892
|
+
kind: symbolKind,
|
|
2893
|
+
line: i + 1,
|
|
2894
|
+
openBraceDepth: braceDepth
|
|
2895
|
+
});
|
|
2896
|
+
}
|
|
2897
|
+
for (const char of lineWithoutComment) {
|
|
2898
|
+
if (char === "{") {
|
|
2899
|
+
braceDepth++;
|
|
2900
|
+
} else if (char === "}") {
|
|
2901
|
+
braceDepth--;
|
|
2902
|
+
if (blockStack.length > 0) {
|
|
2903
|
+
const top = blockStack[blockStack.length - 1];
|
|
2904
|
+
if (top && braceDepth === top.openBraceDepth) {
|
|
2905
|
+
blockStack.pop();
|
|
2906
|
+
const symbol2 = {
|
|
2907
|
+
filePath,
|
|
2908
|
+
name: top.name,
|
|
2909
|
+
kind: top.kind,
|
|
2910
|
+
lineStart: top.line,
|
|
2911
|
+
lineEnd: i + 1,
|
|
2912
|
+
body: lines.slice(top.line - 1, i + 1).join("\n"),
|
|
2913
|
+
docstring: "",
|
|
2914
|
+
parent: ""
|
|
2915
|
+
};
|
|
2916
|
+
symbols.push(symbol2);
|
|
2917
|
+
}
|
|
2918
|
+
}
|
|
2919
|
+
}
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
symbols.sort((a, b) => a.lineStart - b.lineStart);
|
|
2923
|
+
return symbols;
|
|
2924
|
+
}
|
|
2925
|
+
|
|
2926
|
+
// src/languages/caddy.ts
|
|
2927
|
+
init_define_import_meta_env();
|
|
2928
|
+
function symbol(filePath, lines, block, lineEnd) {
|
|
2929
|
+
return {
|
|
2930
|
+
filePath,
|
|
2931
|
+
name: block.name,
|
|
2932
|
+
kind: block.kind,
|
|
2933
|
+
lineStart: block.lineStart,
|
|
2934
|
+
lineEnd,
|
|
2935
|
+
body: lines.slice(block.lineStart - 1, lineEnd).join("\n"),
|
|
2936
|
+
docstring: "",
|
|
2937
|
+
parent: ""
|
|
2938
|
+
};
|
|
2939
|
+
}
|
|
2940
|
+
function extractCaddy(content, filePath) {
|
|
2941
|
+
const lines = content.split("\n");
|
|
2942
|
+
const symbols = [];
|
|
2943
|
+
const stack = [];
|
|
2944
|
+
let braceDepth = 0;
|
|
2945
|
+
let sawContent = false;
|
|
2946
|
+
for (let i = 0; i < lines.length; i++) {
|
|
2947
|
+
const rawLine = lines[i] ?? "";
|
|
2948
|
+
const commentIndex = rawLine.indexOf("#");
|
|
2949
|
+
const codeLine = commentIndex >= 0 ? rawLine.slice(0, commentIndex) : rawLine;
|
|
2950
|
+
const trimmed = codeLine.trim();
|
|
2951
|
+
const depthAtLineStart = braceDepth;
|
|
2952
|
+
const contentBeforeLine = sawContent;
|
|
2953
|
+
let opensSeen = 0;
|
|
2954
|
+
for (let c = 0; c < codeLine.length; c++) {
|
|
2955
|
+
const char = codeLine[c];
|
|
2956
|
+
if (char === "{") {
|
|
2957
|
+
const header = opensSeen === 0 ? codeLine.slice(0, c).trim() : "";
|
|
2958
|
+
if (opensSeen === 0 && depthAtLineStart === 0 && !contentBeforeLine && header === "") {
|
|
2959
|
+
stack.push({ name: "global", kind: "caddy_global", lineStart: i + 1, site: false });
|
|
2960
|
+
} else if (opensSeen === 0 && depthAtLineStart === 0 && header) {
|
|
2961
|
+
const snippet = /^\(([^)]+)\)$/.exec(header);
|
|
2962
|
+
stack.push({
|
|
2963
|
+
name: snippet ? `(${snippet[1]})` : header,
|
|
2964
|
+
kind: snippet ? "caddy_snippet" : "caddy_site",
|
|
2965
|
+
lineStart: i + 1,
|
|
2966
|
+
site: !snippet
|
|
2967
|
+
});
|
|
2968
|
+
} else if (header && /^(?:route|handle|handle_path)\b/.test(header) && stack.some((block) => block.site)) {
|
|
2969
|
+
stack.push({ name: header, kind: "caddy_block", lineStart: i + 1, site: false });
|
|
2970
|
+
} else {
|
|
2971
|
+
stack.push({ name: "", kind: "", lineStart: i + 1, site: false });
|
|
2972
|
+
}
|
|
2973
|
+
opensSeen++;
|
|
2974
|
+
braceDepth++;
|
|
2975
|
+
} else if (char === "}") {
|
|
2976
|
+
braceDepth--;
|
|
2977
|
+
const block = stack[stack.length - 1];
|
|
2978
|
+
if (block && block.kind && braceDepth >= 0) {
|
|
2979
|
+
stack.pop();
|
|
2980
|
+
symbols.push(symbol(filePath, lines, block, i + 1));
|
|
2981
|
+
} else if (block) {
|
|
2982
|
+
stack.pop();
|
|
2983
|
+
}
|
|
2984
|
+
}
|
|
2985
|
+
}
|
|
2986
|
+
if (trimmed) sawContent = true;
|
|
2987
|
+
}
|
|
2988
|
+
return symbols.sort((a, b) => a.lineStart - b.lineStart);
|
|
2989
|
+
}
|
|
2990
|
+
|
|
2991
|
+
// src/languages/apache.ts
|
|
2992
|
+
init_define_import_meta_env();
|
|
2993
|
+
function makeSymbol(filePath, lines, name, kind, lineStart, lineEnd) {
|
|
2994
|
+
return {
|
|
2995
|
+
filePath,
|
|
2996
|
+
name,
|
|
2997
|
+
kind,
|
|
2998
|
+
lineStart,
|
|
2999
|
+
lineEnd,
|
|
3000
|
+
body: lines.slice(lineStart - 1, lineEnd).join("\n"),
|
|
3001
|
+
docstring: "",
|
|
3002
|
+
parent: ""
|
|
3003
|
+
};
|
|
3004
|
+
}
|
|
3005
|
+
function extractApache(content, filePath) {
|
|
3006
|
+
const lines = content.split("\n");
|
|
3007
|
+
const symbols = [];
|
|
3008
|
+
const sections = [];
|
|
3009
|
+
for (let i = 0; i < lines.length; i++) {
|
|
3010
|
+
const lineNumber = i + 1;
|
|
3011
|
+
const rawLine = lines[i] ?? "";
|
|
3012
|
+
const code = rawLine.replace(/^\s*#.*$/, "").trim();
|
|
3013
|
+
if (!code) continue;
|
|
3014
|
+
const closing = /^<\/\s*([A-Za-z][\w-]*)\s*>/i.exec(code);
|
|
3015
|
+
if (closing) {
|
|
3016
|
+
const tag = closing[1]?.toLowerCase();
|
|
3017
|
+
const index = sections.map((section) => section.tag).lastIndexOf(tag ?? "");
|
|
3018
|
+
if (index >= 0) {
|
|
3019
|
+
const section = sections[index];
|
|
3020
|
+
if (section) {
|
|
3021
|
+
sections.splice(index, 1);
|
|
3022
|
+
symbols.push(makeSymbol(filePath, lines, section.name, "apache_section", section.lineStart, lineNumber));
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
3025
|
+
continue;
|
|
3026
|
+
}
|
|
3027
|
+
const opening = /^<\s*([A-Za-z][\w-]*)(?:\s+([^>\s](?:[^>]*[^>\s])?))?\s*>/i.exec(code);
|
|
3028
|
+
if (opening) {
|
|
3029
|
+
const tag = opening[1] ?? "";
|
|
3030
|
+
const args = opening[2]?.trim() ?? "";
|
|
3031
|
+
sections.push({
|
|
3032
|
+
tag: tag.toLowerCase(),
|
|
3033
|
+
name: args ? `${tag} ${args}` : tag,
|
|
3034
|
+
lineStart: lineNumber
|
|
3035
|
+
});
|
|
3036
|
+
continue;
|
|
3037
|
+
}
|
|
3038
|
+
const directive = /^(ServerName|DocumentRoot|Listen)\b(?:[ \t]+(\S(?:[^\r\n]*\S)?))?$/i.exec(code);
|
|
3039
|
+
if (directive) {
|
|
3040
|
+
const name = directive[2] ? `${directive[1]} ${directive[2]}` : directive[1] ?? "";
|
|
3041
|
+
symbols.push(makeSymbol(filePath, lines, name, "apache_directive", lineNumber, lineNumber));
|
|
3042
|
+
}
|
|
3043
|
+
}
|
|
3044
|
+
return symbols.sort((a, b) => a.lineStart - b.lineStart || a.lineEnd - b.lineEnd);
|
|
3045
|
+
}
|
|
3046
|
+
|
|
2808
3047
|
// src/languages/bash_idx.ts
|
|
2809
3048
|
init_define_import_meta_env();
|
|
2810
3049
|
var MAX_SYMBOLS5 = 1e4;
|
|
@@ -3750,10 +3989,10 @@ function extractApex(content, filePath) {
|
|
|
3750
3989
|
const key = `${name}\0${kind}\0${span.startLine}`;
|
|
3751
3990
|
if (seen.has(key)) return;
|
|
3752
3991
|
seen.add(key);
|
|
3753
|
-
const
|
|
3754
|
-
symbols.push(
|
|
3992
|
+
const symbol2 = makeSpanSymbol(filePath, name, kind, span, parent, rawLines, "c");
|
|
3993
|
+
symbols.push(symbol2);
|
|
3755
3994
|
if (CONTAINER_KINDS.has(kind)) return;
|
|
3756
|
-
for (let line = Math.max(0,
|
|
3995
|
+
for (let line = Math.max(0, symbol2.lineStart); line <= symbol2.lineEnd && line < covered.length; line++) covered[line] = 1;
|
|
3757
3996
|
};
|
|
3758
3997
|
for (const match of code.matchAll(TRIGGER_RE2)) {
|
|
3759
3998
|
const name = match[1] ?? "";
|
|
@@ -3936,11 +4175,11 @@ function propertyElements(content) {
|
|
|
3936
4175
|
}
|
|
3937
4176
|
return out;
|
|
3938
4177
|
}
|
|
3939
|
-
function makeRef(content, filePath, name, offset) {
|
|
3940
|
-
const
|
|
3941
|
-
const
|
|
3942
|
-
const
|
|
3943
|
-
const sourceLine = content.slice(lineStart
|
|
4178
|
+
function makeRef(content, lineIndex, filePath, name, offset) {
|
|
4179
|
+
const line = offsetToLine(lineIndex, offset);
|
|
4180
|
+
const lineStart = lineIndex[line - 1] ?? 0;
|
|
4181
|
+
const nextStart = lineIndex[line] ?? content.length + 1;
|
|
4182
|
+
const sourceLine = content.slice(lineStart, nextStart - 1);
|
|
3944
4183
|
return { filePath, name, line, col: offset - lineStart, context: sourceLine.trim() };
|
|
3945
4184
|
}
|
|
3946
4185
|
function emitRef(refs, seen, ref) {
|
|
@@ -3950,11 +4189,11 @@ function emitRef(refs, seen, ref) {
|
|
|
3950
4189
|
seen.add(key);
|
|
3951
4190
|
refs.push(ref);
|
|
3952
4191
|
}
|
|
3953
|
-
function addTagRefs(refs, seen, content, filePath, tags) {
|
|
4192
|
+
function addTagRefs(refs, seen, content, lineIndex, filePath, tags) {
|
|
3954
4193
|
for (const tag of tags) {
|
|
3955
4194
|
for (const block of elementBlocks(content, tag)) {
|
|
3956
4195
|
const name = decodeXml(block.inner.trim());
|
|
3957
|
-
if (name !== "") emitRef(refs, seen, makeRef(content, filePath, name, block.offset));
|
|
4196
|
+
if (name !== "") emitRef(refs, seen, makeRef(content, lineIndex, filePath, name, block.offset));
|
|
3958
4197
|
}
|
|
3959
4198
|
}
|
|
3960
4199
|
}
|
|
@@ -3978,12 +4217,12 @@ function addFlowElements(symbols, seen, content, filePath, flowName) {
|
|
|
3978
4217
|
emit(symbols, seen, makeSpanSymbol(filePath, name, kind, span, flowName));
|
|
3979
4218
|
}
|
|
3980
4219
|
}
|
|
3981
|
-
function emit(symbols, seen,
|
|
3982
|
-
if (!
|
|
3983
|
-
const key = `${
|
|
4220
|
+
function emit(symbols, seen, symbol2) {
|
|
4221
|
+
if (!symbol2.name || symbols.length >= MAX_SYMBOLS11) return;
|
|
4222
|
+
const key = `${symbol2.name}\0${symbol2.kind}\0${symbol2.lineStart}`;
|
|
3984
4223
|
if (seen.has(key)) return;
|
|
3985
4224
|
seen.add(key);
|
|
3986
|
-
symbols.push(
|
|
4225
|
+
symbols.push(symbol2);
|
|
3987
4226
|
}
|
|
3988
4227
|
function emitObjectScopedMetadata(symbols, seen, filePath, content, whole, metadataSuffix, kind) {
|
|
3989
4228
|
const name = metadataName(filePath, content, metadataSuffix);
|
|
@@ -3995,6 +4234,7 @@ function emitObjectScopedMetadata(symbols, seen, filePath, content, whole, metad
|
|
|
3995
4234
|
}
|
|
3996
4235
|
function extractSalesforceMetadata(rawContent, filePath) {
|
|
3997
4236
|
const content = stripXmlComments(rawContent);
|
|
4237
|
+
const lineIndex = buildLineIndex(content);
|
|
3998
4238
|
const symbols = [];
|
|
3999
4239
|
const seen = /* @__PURE__ */ new Set();
|
|
4000
4240
|
const refs = [];
|
|
@@ -4021,7 +4261,7 @@ function extractSalesforceMetadata(rawContent, filePath) {
|
|
|
4021
4261
|
const name2 = basenameWithout(filePath, ".flow-meta.xml");
|
|
4022
4262
|
emit(symbols, seen, makeSpanSymbol(filePath, name2, "sf_flow", whole));
|
|
4023
4263
|
addFlowElements(symbols, seen, content, filePath, name2);
|
|
4024
|
-
addTagRefs(refs, seenRefs, content, filePath, ["actionName", "flowName"]);
|
|
4264
|
+
addTagRefs(refs, seenRefs, content, lineIndex, filePath, ["actionName", "flowName"]);
|
|
4025
4265
|
for (const tag of ["recordLookups", "recordCreates", "recordUpdates", "recordDeletes"]) {
|
|
4026
4266
|
for (const block of elementBlocks(content, tag)) {
|
|
4027
4267
|
const objectBlock = elementBlocks(block.text, "object")[0];
|
|
@@ -4029,7 +4269,7 @@ function extractSalesforceMetadata(rawContent, filePath) {
|
|
|
4029
4269
|
const objectName = decodeXml(objectBlock.inner.trim());
|
|
4030
4270
|
if (objectName === "") continue;
|
|
4031
4271
|
const objectOffset = block.offset + objectBlock.offset;
|
|
4032
|
-
emitRef(refs, seenRefs, makeRef(content, filePath, objectName, objectOffset));
|
|
4272
|
+
emitRef(refs, seenRefs, makeRef(content, lineIndex, filePath, objectName, objectOffset));
|
|
4033
4273
|
let fieldSearchFrom = 0;
|
|
4034
4274
|
for (const field of elementBlocks(block.inner, "field")) {
|
|
4035
4275
|
const fieldName = decodeXml(field.inner.trim());
|
|
@@ -4037,7 +4277,7 @@ function extractSalesforceMetadata(rawContent, filePath) {
|
|
|
4037
4277
|
const idx = block.text.indexOf(field.text, fieldSearchFrom);
|
|
4038
4278
|
const offset = block.offset + (idx >= 0 ? idx : 0);
|
|
4039
4279
|
if (idx >= 0) fieldSearchFrom = idx + field.text.length;
|
|
4040
|
-
emitRef(refs, seenRefs, makeRef(content, filePath, `${objectName}.${fieldName}`, offset));
|
|
4280
|
+
emitRef(refs, seenRefs, makeRef(content, lineIndex, filePath, `${objectName}.${fieldName}`, offset));
|
|
4041
4281
|
}
|
|
4042
4282
|
}
|
|
4043
4283
|
}
|
|
@@ -4078,7 +4318,6 @@ function extractSalesforceMetadata(rawContent, filePath) {
|
|
|
4078
4318
|
const name = companion ?? (base.endsWith(".labels-meta.xml") ? null : xmlText(content, "fullName")) ?? metadataArtifactName(filePath);
|
|
4079
4319
|
emit(symbols, seen, makeSpanSymbol(filePath, name, `sf_${snakeCase(root)}`, whole));
|
|
4080
4320
|
if (base.endsWith(".labels-meta.xml")) {
|
|
4081
|
-
const lineIndex = buildLineIndex(content);
|
|
4082
4321
|
for (const block of elementBlocks(content, "labels")) {
|
|
4083
4322
|
const labelName = xmlText(block.inner, "fullName");
|
|
4084
4323
|
if (labelName === null) continue;
|
|
@@ -4095,7 +4334,6 @@ function extractSalesforceMetadata(rawContent, filePath) {
|
|
|
4095
4334
|
}
|
|
4096
4335
|
}
|
|
4097
4336
|
if (base.endsWith(".js-meta.xml")) {
|
|
4098
|
-
const lineIndex = buildLineIndex(content);
|
|
4099
4337
|
const lwcSeen = /* @__PURE__ */ new Set();
|
|
4100
4338
|
for (const target of elementBlocks(content, "target")) {
|
|
4101
4339
|
const targetName = decodeXml(target.inner.trim());
|
|
@@ -4133,11 +4371,11 @@ function extractSalesforceMetadata(rawContent, filePath) {
|
|
|
4133
4371
|
}
|
|
4134
4372
|
}
|
|
4135
4373
|
if (base.endsWith(".flexipage-meta.xml")) {
|
|
4136
|
-
addTagRefs(refs, seenRefs, content, filePath, ["sobjectType", "componentName"]);
|
|
4374
|
+
addTagRefs(refs, seenRefs, content, lineIndex, filePath, ["sobjectType", "componentName"]);
|
|
4137
4375
|
} else if (base.endsWith(".quickaction-meta.xml")) {
|
|
4138
|
-
addTagRefs(refs, seenRefs, content, filePath, ["targetObject", "lightningComponent"]);
|
|
4376
|
+
addTagRefs(refs, seenRefs, content, lineIndex, filePath, ["targetObject", "lightningComponent"]);
|
|
4139
4377
|
} else if (base.endsWith(".messagechannel-meta.xml")) {
|
|
4140
|
-
addTagRefs(refs, seenRefs, content, filePath, ["fieldName"]);
|
|
4378
|
+
addTagRefs(refs, seenRefs, content, lineIndex, filePath, ["fieldName"]);
|
|
4141
4379
|
}
|
|
4142
4380
|
return { symbols, refs };
|
|
4143
4381
|
}
|
|
@@ -6093,6 +6331,9 @@ var ADAPTER_EXTRACTORS = {
|
|
|
6093
6331
|
graphql: (content, filePath) => extractGraphql(content, filePath).symbols,
|
|
6094
6332
|
sql: extractSql,
|
|
6095
6333
|
ini: extractIni,
|
|
6334
|
+
nginx: extractNginx,
|
|
6335
|
+
caddy: extractCaddy,
|
|
6336
|
+
apache: extractApache,
|
|
6096
6337
|
makefile: extractMakefile,
|
|
6097
6338
|
proto: (content, filePath) => extractProto(content, filePath).symbols,
|
|
6098
6339
|
terraform: extractTerraform,
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
pptxOutline,
|
|
7
7
|
pptxSlideText,
|
|
8
8
|
pptxTextGrep
|
|
9
|
-
} from "./token-goat-chunk-
|
|
10
|
-
import "./token-goat-chunk-
|
|
9
|
+
} from "./token-goat-chunk-MZQORUX5.mjs";
|
|
10
|
+
import "./token-goat-chunk-QTIRVK3M.mjs";
|
|
11
11
|
import "./token-goat-chunk-XTQAOTSO.mjs";
|
|
12
12
|
import "./token-goat-chunk-AH6QILZM.mjs";
|
|
13
|
-
import "./token-goat-chunk-
|
|
13
|
+
import "./token-goat-chunk-TGBSMHPM.mjs";
|
|
14
14
|
import "./token-goat-chunk-NMTKNYGF.mjs";
|
|
15
15
|
import "./token-goat-chunk-Y4AFKTHK.mjs";
|
|
16
16
|
import "./token-goat-chunk-GMOUBOX4.mjs";
|