sfmc-language-lsp 3.17.0 → 4.0.0
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 +26 -0
- package/dist/cjs/codeActions/ampscript.cjs +10 -7
- package/dist/cjs/codeActions/ampscript.d.ts.map +1 -1
- package/dist/cjs/codeActions/ampscript.js.map +1 -1
- package/dist/cjs/codeActions/mcnHandlebars.cjs +8 -4
- package/dist/cjs/codeActions/mcnHandlebars.d.ts.map +1 -1
- package/dist/cjs/codeActions/mcnHandlebars.js.map +1 -1
- package/dist/cjs/codeActions/ssjs.cjs +17 -15
- package/dist/cjs/codeActions/ssjs.d.ts.map +1 -1
- package/dist/cjs/codeActions/ssjs.js.map +1 -1
- package/dist/cjs/diagnostic-rules.cjs +150 -0
- package/dist/cjs/diagnostic-rules.d.ts +81 -0
- package/dist/cjs/diagnostic-rules.d.ts.map +1 -0
- package/dist/cjs/diagnostic-rules.js.map +1 -0
- package/dist/cjs/index.cjs +35 -27
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/package-version.cjs +6 -0
- package/dist/cjs/package-version.d.ts +2 -0
- package/dist/cjs/package-version.d.ts.map +1 -0
- package/dist/cjs/package-version.js.map +1 -0
- package/dist/cjs/utils/handlebarsAst.cjs +6 -4
- package/dist/cjs/utils/handlebarsAst.d.ts +6 -4
- package/dist/cjs/utils/handlebarsAst.d.ts.map +1 -1
- package/dist/cjs/utils/handlebarsAst.js.map +1 -1
- package/dist/cjs/utils/handlebarsScopeTracker.cjs +1 -1
- package/dist/cjs/utils/handlebarsScopeTracker.js.map +1 -1
- package/dist/cjs/validators/ampscript.cjs +55 -72
- package/dist/cjs/validators/ampscript.d.ts.map +1 -1
- package/dist/cjs/validators/ampscript.js.map +1 -1
- package/dist/cjs/validators/gtl.cjs +5 -4
- package/dist/cjs/validators/gtl.d.ts.map +1 -1
- package/dist/cjs/validators/gtl.js.map +1 -1
- package/dist/cjs/validators/mcnHandlebars.cjs +9 -12
- package/dist/cjs/validators/mcnHandlebars.d.ts.map +1 -1
- package/dist/cjs/validators/mcnHandlebars.js.map +1 -1
- package/dist/cjs/validators/ssjs.cjs +49 -72
- package/dist/cjs/validators/ssjs.d.ts.map +1 -1
- package/dist/cjs/validators/ssjs.js.map +1 -1
- package/dist/esm/codeActions/ampscript.d.ts.map +1 -1
- package/dist/esm/codeActions/ampscript.js +10 -7
- package/dist/esm/codeActions/ampscript.js.map +1 -1
- package/dist/esm/codeActions/mcnHandlebars.d.ts.map +1 -1
- package/dist/esm/codeActions/mcnHandlebars.js +8 -4
- package/dist/esm/codeActions/mcnHandlebars.js.map +1 -1
- package/dist/esm/codeActions/ssjs.d.ts.map +1 -1
- package/dist/esm/codeActions/ssjs.js +17 -15
- package/dist/esm/codeActions/ssjs.js.map +1 -1
- package/dist/esm/diagnostic-rules.d.ts +81 -0
- package/dist/esm/diagnostic-rules.d.ts.map +1 -0
- package/dist/esm/diagnostic-rules.js +141 -0
- package/dist/esm/diagnostic-rules.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +17 -17
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package-version.d.ts +2 -0
- package/dist/esm/package-version.d.ts.map +1 -0
- package/dist/esm/package-version.js +3 -0
- package/dist/esm/package-version.js.map +1 -0
- package/dist/esm/utils/handlebarsAst.d.ts +6 -4
- package/dist/esm/utils/handlebarsAst.d.ts.map +1 -1
- package/dist/esm/utils/handlebarsAst.js +5 -3
- package/dist/esm/utils/handlebarsAst.js.map +1 -1
- package/dist/esm/utils/handlebarsScopeTracker.js +1 -1
- package/dist/esm/utils/handlebarsScopeTracker.js.map +1 -1
- package/dist/esm/validators/ampscript.d.ts.map +1 -1
- package/dist/esm/validators/ampscript.js +55 -72
- package/dist/esm/validators/ampscript.js.map +1 -1
- package/dist/esm/validators/gtl.d.ts.map +1 -1
- package/dist/esm/validators/gtl.js +5 -4
- package/dist/esm/validators/gtl.js.map +1 -1
- package/dist/esm/validators/mcnHandlebars.d.ts.map +1 -1
- package/dist/esm/validators/mcnHandlebars.js +9 -12
- package/dist/esm/validators/mcnHandlebars.js.map +1 -1
- package/dist/esm/validators/ssjs.d.ts.map +1 -1
- package/dist/esm/validators/ssjs.js +49 -72
- package/dist/esm/validators/ssjs.js.map +1 -1
- package/dist/types/codeActions/ampscript.d.ts.map +1 -1
- package/dist/types/codeActions/mcnHandlebars.d.ts.map +1 -1
- package/dist/types/codeActions/ssjs.d.ts.map +1 -1
- package/dist/types/diagnostic-rules.d.ts +81 -0
- package/dist/types/diagnostic-rules.d.ts.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/package-version.d.ts +2 -0
- package/dist/types/package-version.d.ts.map +1 -0
- package/dist/types/utils/handlebarsAst.d.ts +6 -4
- package/dist/types/utils/handlebarsAst.d.ts.map +1 -1
- package/dist/types/validators/ampscript.d.ts.map +1 -1
- package/dist/types/validators/gtl.d.ts.map +1 -1
- package/dist/types/validators/mcnHandlebars.d.ts.map +1 -1
- package/dist/types/validators/ssjs.d.ts.map +1 -1
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -56,6 +56,32 @@ Some Core library members only exist up to a maximum `Platform.Load("Core", <ver
|
|
|
56
56
|
|
|
57
57
|
`ErrorUtil` and `ErrorUtil.ThrowWSProxyError` are the first members covered — both are limited to Core version `"1"`.
|
|
58
58
|
|
|
59
|
+
## Diagnostic identities and documentation
|
|
60
|
+
|
|
61
|
+
The [diagnostic rule reference](docs/rules/README.md) covers all 36 public rules and their 47 internal variants. First-party diagnostics carry a canonical `Diagnostic.code` such as `sfmc/amp-arg-types` and a `codeDescription.href` pointing to this repository at `blob/v<LSP package version>/docs/rules/...`. The LSP owns these URLs, even when bundled in an extension with a different version. Versions are embedded at build time; diagnostic creation needs neither the filesystem nor Git.
|
|
62
|
+
|
|
63
|
+
**Migration / semver:** canonical `sfmc/...` codes replace legacy `ampscript/...`, `ssjs/...`, and `handlebars/...` codes and name previously uncoded checks. Consumers comparing codes or reading diagnostic data must migrate. This is a breaking public diagnostic-contract change. Version `4.0.0` introduces this contract as one major step from `3.17.1`. Consumers upgrading from `3.x` must migrate; the new contract and its documentation are not part of `3.17.1`.
|
|
64
|
+
|
|
65
|
+
Quick-fix data now uses `{ sfmc: { variant, payload } }`. Treat `payload` as opaque: it preserves the original primitive string or object rather than flattening it. Use `decodeDiagnosticData(code, data)` to normalize old code + old payload and new code + envelope into the same variant/payload input. Existing code-action handlers accept both formats. Canonical IDs shared by multiple checks require the explicit variant; do not infer a polyfill, replacement, or delimiter fix from the public ID alone. Forward the complete diagnostic, including its data, through editor adapters.
|
|
66
|
+
|
|
67
|
+
Development builds deterministically use the package's prospective version URL. It may not resolve until **a new release tag contains both the code and documentation**. There is no fallback to `main` or an older tag, and existing tags must never be rewritten to add pages. Release this producer before rebuilding downstream consumers. The release workflow checks its own tag, version, commit, and tagged documentation; offline packed-artifact checks exercise CJS, ESM, and the browser-compatible registry graph from an actual npm tarball.
|
|
68
|
+
|
|
69
|
+
### 4.0.0 release notes
|
|
70
|
+
|
|
71
|
+
- **Breaking:** all first-party validators emit canonical public rule IDs and a namespaced, lossless diagnostic-data envelope. Consumers must migrate code comparisons and preserve explicit variants; legacy code-action inputs remain supported.
|
|
72
|
+
- Added 36 rule-reference pages covering 47 variants, plus version-owned documentation URLs for previously unnamed diagnostics. CJS, ESM, and type build entry points embed the same package version without runtime filesystem or Git access.
|
|
73
|
+
- ESLint-overlap suppression now includes the AttributeValue recommendation. Other overlap classifications remain variant-aware; similarly named checks are not assumed interchangeable.
|
|
74
|
+
- Added producer-tag/documentation and packed-artifact safeguards. Downstream consumers must adopt this major only after publication.
|
|
75
|
+
- Adopted `ssjs-data@^2.1.0`, including nine newly catalogued unavailable built-ins from tested Engagement CloudPages. They have no bundled verified polyfill. The shared SSJS validator continues to delegate such absences to consumer TypeScript checks; it does not fabricate polyfill diagnostics or actions. This is not evidence for email or every execution context.
|
|
76
|
+
|
|
77
|
+
### Pre-release consumer acceptance
|
|
78
|
+
|
|
79
|
+
From the multi-repository development workspace root, run `npm run test:diagnostic-integration`. The harness copies source, locks and fixtures into temporary staging, excludes existing installations, builds and packs this producer, and installs that tarball explicitly into both extension resolution sites and the MCP consumer. All npm installs are cache-only; a missing cached dependency is a reported blocker. Build, lint and full consumer tests remain required, including the extension host (which requires an available VS Code test runtime). The command removes staging when it finishes.
|
|
80
|
+
|
|
81
|
+
The **declared-dependency baseline** first installs the unchanged consumer locks and reports their build/test status. Those locks still resolve released `3.17.1` and cannot satisfy the new canonical diagnostic tests; plain `npm ci` is not claimed to pass feature acceptance. **Local-producer acceptance** then installs the packed prospective `4.0.0` with `--no-save` only inside staging (retaining lock-based resolution of unrelated dependencies). A passing local run is not registry or release-provenance evidence.
|
|
82
|
+
|
|
83
|
+
For release, publish the new breaking LSP version and its tagged documentation first. Only after it is available, update the extension root/server and MCP dependency manifests to the new major range (prospectively `^4.0.0`), refresh their locks, and repeat clean-install acceptance without a local override. The extension additionally runs **release-only** `npm run verify:lsp-release --no-workspaces`: it resolves the actually bundled LSP, uses `gh` to resolve that exact tag to an immutable commit, and verifies its manifest and every registry-linked rule page in that commit. Ordinary tests use offline negative fixtures; no diagnostic emission performs network or Git operations.
|
|
84
|
+
|
|
59
85
|
## Install
|
|
60
86
|
|
|
61
87
|
```bash
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAmpscriptCodeActions = getAmpscriptCodeActions;
|
|
4
4
|
const types_js_1 = require("../types.cjs");
|
|
5
|
+
const diagnostic_rules_js_1 = require("../diagnostic-rules.cjs");
|
|
5
6
|
const positions_js_1 = require("../utils/positions.cjs");
|
|
6
7
|
const ampscript_js_1 = require("../validators/ampscript.cjs");
|
|
7
8
|
/**
|
|
@@ -31,10 +32,14 @@ function buildActionsForDiagnostic(text, uri, diagnostic) {
|
|
|
31
32
|
const actions = [];
|
|
32
33
|
const range = diagnostic.range;
|
|
33
34
|
const originalText = (0, positions_js_1.getTextInRange)(text, range);
|
|
34
|
-
|
|
35
|
+
const decoded = (0, diagnostic_rules_js_1.decodeDiagnosticData)(diagnostic.code, diagnostic.data);
|
|
36
|
+
if (!decoded)
|
|
37
|
+
return actions;
|
|
38
|
+
const { variant, payload } = decoded;
|
|
39
|
+
switch (variant) {
|
|
35
40
|
case ampscript_js_1.DIAG_CODE_HTML_WRAPPED_COMMENT: {
|
|
36
|
-
const inner = typeof
|
|
37
|
-
?
|
|
41
|
+
const inner = typeof payload === 'string'
|
|
42
|
+
? payload
|
|
38
43
|
: originalText.replace(/^<!--/, '').replace(/-->$/, '').trim();
|
|
39
44
|
actions.push({
|
|
40
45
|
title: 'Remove HTML comment wrapper',
|
|
@@ -57,9 +62,7 @@ function buildActionsForDiagnostic(text, uri, diagnostic) {
|
|
|
57
62
|
break;
|
|
58
63
|
}
|
|
59
64
|
case ampscript_js_1.DIAG_CODE_JS_LINE_COMMENT: {
|
|
60
|
-
const commentText = typeof
|
|
61
|
-
? diagnostic.data
|
|
62
|
-
: originalText.replace(/^\/\/\s*/, '').trim();
|
|
65
|
+
const commentText = typeof payload === 'string' ? payload : originalText.replace(/^\/\/\s*/, '').trim();
|
|
63
66
|
actions.push({
|
|
64
67
|
title: 'Convert to AMPscript block comment',
|
|
65
68
|
kind: types_js_1.CodeActionKind.QuickFix,
|
|
@@ -90,7 +93,7 @@ function buildActionsForDiagnostic(text, uri, diagnostic) {
|
|
|
90
93
|
}
|
|
91
94
|
case ampscript_js_1.DIAG_CODE_NESTED_DELIMITER_IN_SCRIPT:
|
|
92
95
|
case ampscript_js_1.DIAG_CODE_NESTED_DELIMITER: {
|
|
93
|
-
const delimiter = typeof
|
|
96
|
+
const delimiter = typeof payload === 'string' ? payload : originalText;
|
|
94
97
|
const isBlock = delimiter === '%%[';
|
|
95
98
|
const actualCloseToken = isBlock ? ']%%' : '=%%';
|
|
96
99
|
const actualCloseLen = actualCloseToken.length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ampscript.d.ts","sourceRoot":"","sources":["../../../src/codeActions/ampscript.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ampscript.d.ts","sourceRoot":"","sources":["../../../src/codeActions/ampscript.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAS,MAAM,aAAa,CAAC;AAWjE;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACnC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,UAAU,EAAE,GAC1B,UAAU,EAAE,CASd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ampscript.js","sourceRoot":"","sources":["../../../src/codeActions/ampscript.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"ampscript.js","sourceRoot":"","sources":["../../../src/codeActions/ampscript.ts"],"names":[],"mappings":";;AAoBA,0DAaC;AAjCD,0CAA6C;AAC7C,gEAA8D;AAE9D,wDAA2F;AAC3F,6DAOoC;AAEpC;;;;;;GAMG;AACH,SAAgB,uBAAuB,CACnC,IAAY,EACZ,GAAW,EACX,WAAyB;IAEzB,MAAM,OAAO,GAAiB,EAAE,CAAC;IAEjC,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACnC,IAAI,UAAU,CAAC,MAAM,KAAK,WAAW;YAAE,SAAS;QAChD,OAAO,CAAC,IAAI,CAAC,GAAG,yBAAyB,CAAC,IAAI,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC;AAED;;;;;;GAMG;AACH,SAAS,yBAAyB,CAC9B,IAAY,EACZ,GAAW,EACX,UAAsB;IAEtB,MAAM,OAAO,GAAi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AC,GAAG,CAAC,EAAE;gCACH;oCACI,KAAK,EAAE,kBAAkB,CAAC,IAAI,EAAE,UAAU,EAAE,cAAc,CAAC;oCAC3D,OAAO,EAAE,EAAE;iCACd;gCACD,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;6BACzB;yBACJ;qBACJ;iBACJ,CAAC,CAAC;YACP,CAAC;YACD,MAAM;QACV,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAY,EAAE,KAAa,EAAE,GAAW;IAChE,OAAO;QACH,KAAK,EAAE,IAAA,+BAAgB,EAAC,IAAI,EAAE,KAAK,CAAC;QACpC,GAAG,EAAE,IAAA,+BAAgB,EAAC,IAAI,EAAE,GAAG,CAAC;KACnC,CAAC;AACN,CAAC"}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.getHandlebarsCodeActions = getHandlebarsCodeActions;
|
|
11
11
|
const types_js_1 = require("../types.cjs");
|
|
12
|
+
const diagnostic_rules_js_1 = require("../diagnostic-rules.cjs");
|
|
12
13
|
const positions_js_1 = require("../utils/positions.cjs");
|
|
13
14
|
const mcnHandlebars_js_1 = require("../validators/mcnHandlebars.cjs");
|
|
14
15
|
/**
|
|
@@ -56,13 +57,16 @@ function getHandlebarsCodeActions(text, uri, diagnostics) {
|
|
|
56
57
|
for (const diagnostic of diagnostics) {
|
|
57
58
|
if (diagnostic.source !== 'handlebars')
|
|
58
59
|
continue;
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
const decoded = (0, diagnostic_rules_js_1.decodeDiagnosticData)(diagnostic.code, diagnostic.data);
|
|
61
|
+
if (!decoded)
|
|
62
|
+
continue;
|
|
63
|
+
const { variant, payload } = decoded;
|
|
64
|
+
if (variant !== mcnHandlebars_js_1.DIAG_CODE_HBS_UNKNOWN_HELPER && variant !== mcnHandlebars_js_1.DIAG_CODE_HBS_UNKNOWN_BINDING) {
|
|
61
65
|
continue;
|
|
62
66
|
}
|
|
63
|
-
if (!isSuggestionData(
|
|
67
|
+
if (!isSuggestionData(payload))
|
|
64
68
|
continue;
|
|
65
|
-
const { typed, suggestion } =
|
|
69
|
+
const { typed, suggestion } = payload;
|
|
66
70
|
const editRange = tokenRange(text, diagnostic.range, typed);
|
|
67
71
|
actions.push({
|
|
68
72
|
title: `Replace '${typed}' with '${suggestion}'`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcnHandlebars.d.ts","sourceRoot":"","sources":["../../../src/codeActions/mcnHandlebars.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"mcnHandlebars.d.ts","sourceRoot":"","sources":["../../../src/codeActions/mcnHandlebars.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAS,MAAM,aAAa,CAAC;AA4CjE;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACpC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,UAAU,EAAE,GAC1B,UAAU,EAAE,CA0Bd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcnHandlebars.js","sourceRoot":"","sources":["../../../src/codeActions/mcnHandlebars.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;
|
|
1
|
+
{"version":3,"file":"mcnHandlebars.js","sourceRoot":"","sources":["../../../src/codeActions/mcnHandlebars.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAuDH,4DA8BC;AAnFD,0CAA6C;AAC7C,gEAA8D;AAE9D,wDAA2F;AAC3F,qEAIwC;AAExC;;;;;GAKG;AACH,SAAS,gBAAgB,CAAC,IAAa;IACnC,OAAO,CACH,OAAO,IAAI,KAAK,QAAQ;QACxB,IAAI,KAAK,IAAI;QACb,OAAQ,IAAiC,CAAC,KAAK,KAAK,QAA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AAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;QACtC,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAE5D,OAAO,CAAC,IAAI,CAAC;YACT,KAAK,EAAE,YAAY,KAAK,WAAW,UAAU,GAAG;YAChD,IAAI,EAAE,yBAAc,CAAC,QAAQ;YAC7B,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,CAAC,UAAU,CAAC;YACzB,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,EAAE;SAC5E,CAAC,CAAC;IACP,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSsjsCodeActions = getSsjsCodeActions;
|
|
4
4
|
const types_js_1 = require("../types.cjs");
|
|
5
|
+
const diagnostic_rules_js_1 = require("../diagnostic-rules.cjs");
|
|
5
6
|
const ssjs_js_1 = require("../validators/ssjs.cjs");
|
|
6
7
|
const polyfill_js_1 = require("../utils/polyfill.cjs");
|
|
7
8
|
/**
|
|
@@ -129,11 +130,14 @@ function getSsjsCodeActions(text, uri, diagnostics) {
|
|
|
129
130
|
for (const diagnostic of diagnostics) {
|
|
130
131
|
if (diagnostic.source !== 'ssjs')
|
|
131
132
|
continue;
|
|
133
|
+
const decoded = (0, diagnostic_rules_js_1.decodeDiagnosticData)(diagnostic.code, diagnostic.data);
|
|
134
|
+
if (!decoded)
|
|
135
|
+
continue;
|
|
136
|
+
const { variant, payload } = decoded;
|
|
132
137
|
// "Replace with Platform.Function.*" — for static members that have no
|
|
133
138
|
// polyfill but a direct SFMC alternative (e.g. JSON.parse → ParseJSON).
|
|
134
|
-
if (
|
|
135
|
-
|
|
136
|
-
const { owner, member, replacement } = diagnostic.data;
|
|
139
|
+
if (variant === ssjs_js_1.DIAG_CODE_SSJS_REPLACE_WITH_PLATFORM_FUNCTION && isReplaceData(payload)) {
|
|
140
|
+
const { owner, member, replacement } = payload;
|
|
137
141
|
actions.push({
|
|
138
142
|
title: `Replace ${owner}.${member} with ${replacement}`,
|
|
139
143
|
kind: types_js_1.CodeActionKind.QuickFix,
|
|
@@ -151,9 +155,8 @@ function getSsjsCodeActions(text, uri, diagnostics) {
|
|
|
151
155
|
}
|
|
152
156
|
// "Read headers via getHeaderMap()" — rewrite a CLR-unsafe `.headers`
|
|
153
157
|
// read and insert the helper (once) at the top of the document.
|
|
154
|
-
if (
|
|
155
|
-
|
|
156
|
-
const { respName, keyText } = diagnostic.data;
|
|
158
|
+
if (variant === ssjs_js_1.DIAG_CODE_SSJS_CLR_HEADER_ACCESS && isClrHeaderAccessData(payload)) {
|
|
159
|
+
const { respName, keyText } = payload;
|
|
157
160
|
const edits = [
|
|
158
161
|
{
|
|
159
162
|
// Replace the whole flagged expression with getHeaderMap(resp)[key].
|
|
@@ -179,9 +182,8 @@ function getSsjsCodeActions(text, uri, diagnostics) {
|
|
|
179
182
|
continue;
|
|
180
183
|
}
|
|
181
184
|
// "Wrap with String()" — rewrite a raw `.content` read to String(resp.content).
|
|
182
|
-
if (
|
|
183
|
-
|
|
184
|
-
const { contentText } = diagnostic.data;
|
|
185
|
+
if (variant === ssjs_js_1.DIAG_CODE_SSJS_CLR_CONTENT_ACCESS && isClrContentAccessData(payload)) {
|
|
186
|
+
const { contentText } = payload;
|
|
185
187
|
actions.push({
|
|
186
188
|
title: `Wrap with String(${contentText})`,
|
|
187
189
|
kind: types_js_1.CodeActionKind.QuickFix,
|
|
@@ -198,9 +200,9 @@ function getSsjsCodeActions(text, uri, diagnostics) {
|
|
|
198
200
|
// "Replace with <allowed value>" — for invalid literal assignments to an
|
|
199
201
|
// HttpRequest/HttpGet property with an enum constraint. One action per
|
|
200
202
|
// allowed value; numeric constraints offer no replacement (empty list).
|
|
201
|
-
if (
|
|
202
|
-
isInvalidHttpPropertyData(
|
|
203
|
-
const { suggestions } =
|
|
203
|
+
if (variant === ssjs_js_1.DIAG_CODE_SSJS_INVALID_HTTP_PROPERTY &&
|
|
204
|
+
isInvalidHttpPropertyData(payload)) {
|
|
205
|
+
const { suggestions } = payload;
|
|
204
206
|
for (const [index, suggestion] of suggestions.entries()) {
|
|
205
207
|
const title = suggestion.label
|
|
206
208
|
? `Replace with ${suggestion.code} (${suggestion.label})`
|
|
@@ -220,11 +222,11 @@ function getSsjsCodeActions(text, uri, diagnostics) {
|
|
|
220
222
|
}
|
|
221
223
|
continue;
|
|
222
224
|
}
|
|
223
|
-
if (
|
|
225
|
+
if (variant !== ssjs_js_1.DIAG_CODE_SSJS_POLYFILL_REQUIRED)
|
|
224
226
|
continue;
|
|
225
|
-
if (!isPolyfillData(
|
|
227
|
+
if (!isPolyfillData(payload))
|
|
226
228
|
continue;
|
|
227
|
-
const { owner, method, polyfill } =
|
|
229
|
+
const { owner, method, polyfill } = payload;
|
|
228
230
|
// Avoid offering the fix when the polyfill is already present in the
|
|
229
231
|
// document. The first non-blank line of the polyfill is a stable marker.
|
|
230
232
|
const marker = (0, polyfill_js_1.polyfillMarker)(polyfill);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssjs.d.ts","sourceRoot":"","sources":["../../../src/codeActions/ssjs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ssjs.d.ts","sourceRoot":"","sources":["../../../src/codeActions/ssjs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA8I1D;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAC9B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,UAAU,EAAE,GAC1B,UAAU,EAAE,CAwId"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssjs.js","sourceRoot":"","sources":["../../../src/codeActions/ssjs.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"ssjs.js","sourceRoot":"","sources":["../../../src/codeActions/ssjs.ts"],"names":[],"mappings":";;AAyJA,gDA4IC;AArSD,0CAA6C;AAC7C,gEAA8D;AAE9D,mDAW+B;AAC/B,sDAAsD;AAEtD;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;EAmBxB,CAAC;AAEH;;;;;;;GAOG;AACH,SAAS,sBAAsB,CAAC,IAAY;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/B,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;QAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACnC,sEAAsE;QACtE,IAAI,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7D,OAAO,EAAE,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;QAC7C,CAAC;QACD,uEAAuE;QACvE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IACrC,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;AACrC,CAAC;AAED;;;;;GAKG;AACH,SAAS,cAAc,CAAC,IAAa;IACjC,OAAO,CACH,OAAO,IAAI,KAAK,QAAQ;QACxB,IAAI,KAAK,IAAI;QACb,OAAQ,IAA+B,CAAC,KAAK,KAAK,QAAQ;QAC1D,OAAQ,IAA+B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AAW,EAAE,IAAI;YACjB,WAAW,EAAE,CAAC,UAAU,CAAC;YACzB,IAAI,EAAE;gBACF,OAAO,EAAE;oBACL,CAAC,GAAG,CAAC,EAAE;wBACH;4BACI,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE;4BACzC,OAAO,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,MAAM;yBACvC;qBACJ;iBACJ;aACJ;SACJ,CAAC,CAAC;IACP,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LSP_PACKAGE_VERSION = exports.DIAGNOSTIC_RULES = void 0;
|
|
4
|
+
exports.getDiagnosticRule = getDiagnosticRule;
|
|
5
|
+
exports.getDiagnosticDocumentationUrl = getDiagnosticDocumentationUrl;
|
|
6
|
+
exports.encodeDiagnosticData = encodeDiagnosticData;
|
|
7
|
+
exports.decodeDiagnosticData = decodeDiagnosticData;
|
|
8
|
+
exports.createDiagnostic = createDiagnostic;
|
|
9
|
+
const package_version_js_1 = require("./package-version.cjs");
|
|
10
|
+
/**
|
|
11
|
+
Explicit variant identities, including names reserved for formerly unnamed sites.
|
|
12
|
+
*/
|
|
13
|
+
const definitions = [
|
|
14
|
+
['ampscript/html-wrapped-comment', 'amp-no-html-comment', true, true],
|
|
15
|
+
['ampscript/html-comment', 'amp-no-html-comment', true, true],
|
|
16
|
+
['ampscript/js-line-comment', 'amp-no-js-line-comment', true, true],
|
|
17
|
+
['ampscript/nested-script-tag', 'amp-no-nested-script-tag', true, true],
|
|
18
|
+
['ampscript/nested-delimiter-in-script', 'amp-no-nested-ampscript-delimiter', true, true],
|
|
19
|
+
['ampscript/nested-delimiter', 'amp-no-nested-ampscript-delimiter', true, true],
|
|
20
|
+
['ampscript/deprecated-function', 'amp-no-deprecated-function', true, true],
|
|
21
|
+
['ampscript/nonfunctional-function', 'amp-no-nonfunctional-function', true, true],
|
|
22
|
+
['ampscript/unknown-function', 'amp-no-unknown-function', true, true],
|
|
23
|
+
['ampscript/function-arity', 'amp-function-arity', true, true],
|
|
24
|
+
['ampscript/arg-type', 'amp-arg-types', true, true],
|
|
25
|
+
['ampscript/enum-value', 'amp-arg-types', true, true],
|
|
26
|
+
['ampscript/smart-quotes', 'amp-no-smart-quotes', true, true],
|
|
27
|
+
['ampscript/set-no-target', 'amp-set-requires-target', true, true],
|
|
28
|
+
['ampscript/mcn-unsupported-function', 'amp-no-mcn-unsupported', true, true],
|
|
29
|
+
['ampscript/unclosed-block', 'amp-balanced-delimiters', false, false],
|
|
30
|
+
['ampscript/unexpected-block-close', 'amp-balanced-delimiters', false, false],
|
|
31
|
+
['ampscript/unclosed-inline', 'amp-balanced-delimiters', false, false],
|
|
32
|
+
['ampscript/unexpected-inline-close', 'amp-balanced-delimiters', false, false],
|
|
33
|
+
['ampscript/unmatched-endif', 'amp-balanced-control-flow', false, false],
|
|
34
|
+
['ampscript/unmatched-next', 'amp-balanced-control-flow', false, false],
|
|
35
|
+
['ampscript/unclosed-if', 'amp-balanced-control-flow', false, false],
|
|
36
|
+
['ampscript/unclosed-for', 'amp-balanced-control-flow', false, false],
|
|
37
|
+
['ampscript/prefer-attribute-value', 'amp-prefer-attribute-value', true, false],
|
|
38
|
+
['ssjs/polyfill-required', 'ssjs-no-unavailable-method', true, true],
|
|
39
|
+
['ssjs/replace-with-platform-function', 'ssjs-no-unavailable-method', true, true],
|
|
40
|
+
['ssjs/mcn-not-supported', 'ssjs-no-mcn-unsupported', true, true],
|
|
41
|
+
['ssjs/require-platform-load', 'ssjs-require-platform-load', true, true],
|
|
42
|
+
['ssjs/platform-load-version', 'ssjs-prefer-platform-load-version', true, true],
|
|
43
|
+
['ssjs/unsupported-syntax', 'ssjs-no-unsupported-syntax', true, true],
|
|
44
|
+
['ssjs/clr-header-access', 'ssjs-no-clr-header-access', true, true],
|
|
45
|
+
['ssjs/clr-content-access', 'ssjs-require-string-clr-content', true, true],
|
|
46
|
+
['ssjs/invalid-http-property-value', 'ssjs-http-property-value', true, true],
|
|
47
|
+
['ssjs/invalid-property-access', 'ssjs-no-invalid-property-access', true, true],
|
|
48
|
+
['ssjs/nonexistent-global', 'ssjs-no-nonexistent-global', true, true],
|
|
49
|
+
['ssjs/deprecated', 'ssjs-no-deprecated-function', true, true],
|
|
50
|
+
['ssjs/invalid-arity', 'ssjs-platform-function-arity', true, true],
|
|
51
|
+
['ssjs/nonfunctional-method', 'ssjs-no-nonfunctional-method', true, true],
|
|
52
|
+
['ssjs/switch-fallthrough', 'ssjs-no-switch-fallthrough', true, true],
|
|
53
|
+
['ssjs/new-object-returning-constructor', 'ssjs-no-object-returning-constructor', false, true],
|
|
54
|
+
['ssjs/cross-block-forward-reference', 'ssjs-no-cross-block-forward-reference', false, true],
|
|
55
|
+
['handlebars/syntax-error', 'hbs-syntax-error', false, true],
|
|
56
|
+
['handlebars/unsupported-construct', 'hbs-no-unsupported-construct', true, true],
|
|
57
|
+
['handlebars/unknown-helper', 'hbs-no-unknown-helper', true, true],
|
|
58
|
+
['handlebars/unknown-binding', 'hbs-no-unknown-binding', true, true],
|
|
59
|
+
['gtl/unexpected-close', 'gtl-balanced-blocks', false, false],
|
|
60
|
+
['gtl/unclosed-block', 'gtl-balanced-blocks', false, false],
|
|
61
|
+
];
|
|
62
|
+
exports.DIAGNOSTIC_RULES = Object.freeze(definitions.map(([variant, name, overlap, legacy]) => Object.freeze({
|
|
63
|
+
variant,
|
|
64
|
+
ruleId: `sfmc/${name}`,
|
|
65
|
+
documentationPath: `docs/rules/${name.replace('-', '/')}.md`,
|
|
66
|
+
legacyCode: legacy ? variant : null,
|
|
67
|
+
eslintRuleId: overlap ? `sfmc/${name}` : null,
|
|
68
|
+
suppressWithEslint: overlap,
|
|
69
|
+
})));
|
|
70
|
+
/**
|
|
71
|
+
* Resolve an internal variant without accepting inherited object properties.
|
|
72
|
+
* @param variant - Internal variant identity.
|
|
73
|
+
* @returns The registry row, or undefined for an unknown identity.
|
|
74
|
+
*/
|
|
75
|
+
function getDiagnosticRule(variant) {
|
|
76
|
+
return exports.DIAGNOSTIC_RULES.find((rule) => rule.variant === variant);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Build an owning-package release link; development tags may not exist yet.
|
|
80
|
+
* @param variant - Internal variant identity.
|
|
81
|
+
* @returns An HTTPS link pinned to the LSP package version.
|
|
82
|
+
*/
|
|
83
|
+
function getDiagnosticDocumentationUrl(variant) {
|
|
84
|
+
const rule = getDiagnosticRule(variant);
|
|
85
|
+
if (!rule)
|
|
86
|
+
throw new Error(`Unknown diagnostic variant: ${variant}`);
|
|
87
|
+
return `https://github.com/JoernBerkefeld/sfmc-language-lsp/blob/v${package_version_js_1.LSP_PACKAGE_VERSION}/${rule.documentationPath}`;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Preserve primitive and object payloads under a namespaced envelope.
|
|
91
|
+
* @param variant - Exact internal check identity.
|
|
92
|
+
* @param payload - Original JSON-serializable diagnostic data, or undefined when absent.
|
|
93
|
+
* @returns The transport envelope without mutation or cloning of the payload.
|
|
94
|
+
*/
|
|
95
|
+
function encodeDiagnosticData(variant, payload) {
|
|
96
|
+
if (!getDiagnosticRule(variant))
|
|
97
|
+
throw new Error(`Unknown diagnostic variant: ${variant}`);
|
|
98
|
+
return { sfmc: { variant, payload } };
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Decode legacy data or canonical envelopes into the same quick-fix input.
|
|
102
|
+
* Canonical many-to-one rules always require a matching explicit variant.
|
|
103
|
+
* Unnamed legacy diagnostics cannot be decoded without inventing an identity.
|
|
104
|
+
* @param code - Protocol diagnostic code (numeric third-party codes are ignored).
|
|
105
|
+
* @param data - Original diagnostic data or namespaced envelope.
|
|
106
|
+
* @returns Normalized input, or undefined for unknown, malformed or ambiguous codes.
|
|
107
|
+
*/
|
|
108
|
+
function decodeDiagnosticData(code, data) {
|
|
109
|
+
if (typeof code !== 'string')
|
|
110
|
+
return undefined;
|
|
111
|
+
const legacy = exports.DIAGNOSTIC_RULES.find((rule) => rule.legacyCode === code);
|
|
112
|
+
// Legacy payloads are opaque: even an object containing `sfmc` is preserved.
|
|
113
|
+
if (legacy)
|
|
114
|
+
return { variant: legacy.variant, payload: data };
|
|
115
|
+
const candidates = exports.DIAGNOSTIC_RULES.filter((rule) => rule.ruleId === code);
|
|
116
|
+
if (candidates.length === 0)
|
|
117
|
+
return undefined;
|
|
118
|
+
if (typeof data === 'object' && data !== null && Object.hasOwn(data, 'sfmc')) {
|
|
119
|
+
const envelope = data.sfmc;
|
|
120
|
+
if (typeof envelope !== 'object' ||
|
|
121
|
+
envelope === null ||
|
|
122
|
+
!Object.hasOwn(envelope, 'variant'))
|
|
123
|
+
return undefined;
|
|
124
|
+
const { variant, payload } = envelope;
|
|
125
|
+
const match = candidates.find((rule) => rule.variant === variant);
|
|
126
|
+
return match ? { variant: match.variant, payload } : undefined;
|
|
127
|
+
}
|
|
128
|
+
// A unique canonical ID can safely normalize an unenveloped payload.
|
|
129
|
+
return candidates.length === 1 ? { variant: candidates[0].variant, payload: data } : undefined;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Attach the public identity and release documentation to a first-party emission.
|
|
133
|
+
* @param variant - Exact internal check identity, including formerly unnamed checks.
|
|
134
|
+
* @param diagnostic - Diagnostic content with the original opaque payload.
|
|
135
|
+
* @returns A new diagnostic carrying canonical metadata and a lossless envelope.
|
|
136
|
+
*/
|
|
137
|
+
function createDiagnostic(variant, diagnostic) {
|
|
138
|
+
const rule = getDiagnosticRule(variant);
|
|
139
|
+
if (!rule)
|
|
140
|
+
throw new Error(`Unknown diagnostic variant: ${variant}`);
|
|
141
|
+
return {
|
|
142
|
+
...diagnostic,
|
|
143
|
+
code: rule.ruleId,
|
|
144
|
+
codeDescription: { href: getDiagnosticDocumentationUrl(variant) },
|
|
145
|
+
data: encodeDiagnosticData(variant, diagnostic.data),
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
var package_version_js_2 = require("./package-version.cjs");
|
|
149
|
+
Object.defineProperty(exports, "LSP_PACKAGE_VERSION", { enumerable: true, get: function () { return package_version_js_2.LSP_PACKAGE_VERSION; } });
|
|
150
|
+
//# sourceMappingURL=diagnostic-rules.js.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { Diagnostic } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
Explicit variant identities, including names reserved for formerly unnamed sites.
|
|
4
|
+
*/
|
|
5
|
+
declare const definitions: readonly [readonly ["ampscript/html-wrapped-comment", "amp-no-html-comment", true, true], readonly ["ampscript/html-comment", "amp-no-html-comment", true, true], readonly ["ampscript/js-line-comment", "amp-no-js-line-comment", true, true], readonly ["ampscript/nested-script-tag", "amp-no-nested-script-tag", true, true], readonly ["ampscript/nested-delimiter-in-script", "amp-no-nested-ampscript-delimiter", true, true], readonly ["ampscript/nested-delimiter", "amp-no-nested-ampscript-delimiter", true, true], readonly ["ampscript/deprecated-function", "amp-no-deprecated-function", true, true], readonly ["ampscript/nonfunctional-function", "amp-no-nonfunctional-function", true, true], readonly ["ampscript/unknown-function", "amp-no-unknown-function", true, true], readonly ["ampscript/function-arity", "amp-function-arity", true, true], readonly ["ampscript/arg-type", "amp-arg-types", true, true], readonly ["ampscript/enum-value", "amp-arg-types", true, true], readonly ["ampscript/smart-quotes", "amp-no-smart-quotes", true, true], readonly ["ampscript/set-no-target", "amp-set-requires-target", true, true], readonly ["ampscript/mcn-unsupported-function", "amp-no-mcn-unsupported", true, true], readonly ["ampscript/unclosed-block", "amp-balanced-delimiters", false, false], readonly ["ampscript/unexpected-block-close", "amp-balanced-delimiters", false, false], readonly ["ampscript/unclosed-inline", "amp-balanced-delimiters", false, false], readonly ["ampscript/unexpected-inline-close", "amp-balanced-delimiters", false, false], readonly ["ampscript/unmatched-endif", "amp-balanced-control-flow", false, false], readonly ["ampscript/unmatched-next", "amp-balanced-control-flow", false, false], readonly ["ampscript/unclosed-if", "amp-balanced-control-flow", false, false], readonly ["ampscript/unclosed-for", "amp-balanced-control-flow", false, false], readonly ["ampscript/prefer-attribute-value", "amp-prefer-attribute-value", true, false], readonly ["ssjs/polyfill-required", "ssjs-no-unavailable-method", true, true], readonly ["ssjs/replace-with-platform-function", "ssjs-no-unavailable-method", true, true], readonly ["ssjs/mcn-not-supported", "ssjs-no-mcn-unsupported", true, true], readonly ["ssjs/require-platform-load", "ssjs-require-platform-load", true, true], readonly ["ssjs/platform-load-version", "ssjs-prefer-platform-load-version", true, true], readonly ["ssjs/unsupported-syntax", "ssjs-no-unsupported-syntax", true, true], readonly ["ssjs/clr-header-access", "ssjs-no-clr-header-access", true, true], readonly ["ssjs/clr-content-access", "ssjs-require-string-clr-content", true, true], readonly ["ssjs/invalid-http-property-value", "ssjs-http-property-value", true, true], readonly ["ssjs/invalid-property-access", "ssjs-no-invalid-property-access", true, true], readonly ["ssjs/nonexistent-global", "ssjs-no-nonexistent-global", true, true], readonly ["ssjs/deprecated", "ssjs-no-deprecated-function", true, true], readonly ["ssjs/invalid-arity", "ssjs-platform-function-arity", true, true], readonly ["ssjs/nonfunctional-method", "ssjs-no-nonfunctional-method", true, true], readonly ["ssjs/switch-fallthrough", "ssjs-no-switch-fallthrough", true, true], readonly ["ssjs/new-object-returning-constructor", "ssjs-no-object-returning-constructor", false, true], readonly ["ssjs/cross-block-forward-reference", "ssjs-no-cross-block-forward-reference", false, true], readonly ["handlebars/syntax-error", "hbs-syntax-error", false, true], readonly ["handlebars/unsupported-construct", "hbs-no-unsupported-construct", true, true], readonly ["handlebars/unknown-helper", "hbs-no-unknown-helper", true, true], readonly ["handlebars/unknown-binding", "hbs-no-unknown-binding", true, true], readonly ["gtl/unexpected-close", "gtl-balanced-blocks", false, false], readonly ["gtl/unclosed-block", "gtl-balanced-blocks", false, false]];
|
|
6
|
+
export type DiagnosticVariant = (typeof definitions)[number][0];
|
|
7
|
+
export type DiagnosticRuleId = `sfmc/${(typeof definitions)[number][1]}`;
|
|
8
|
+
/**
|
|
9
|
+
One row per internal variant, not per public rule (which may be many-to-one).
|
|
10
|
+
*/
|
|
11
|
+
export interface DiagnosticRule {
|
|
12
|
+
readonly variant: DiagnosticVariant;
|
|
13
|
+
readonly ruleId: DiagnosticRuleId;
|
|
14
|
+
readonly documentationPath: string;
|
|
15
|
+
/**
|
|
16
|
+
Null for previously unnamed emissions; never match those by message text.
|
|
17
|
+
*/
|
|
18
|
+
readonly legacyCode: DiagnosticVariant | null;
|
|
19
|
+
/**
|
|
20
|
+
Null means LSP-only, even if an ESLint rule has a superficially similar name.
|
|
21
|
+
*/
|
|
22
|
+
readonly eslintRuleId: DiagnosticRuleId | null;
|
|
23
|
+
/**
|
|
24
|
+
Includes the intentional AttributeValue correction, applied upon validator migration.
|
|
25
|
+
*/
|
|
26
|
+
readonly suppressWithEslint: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare const DIAGNOSTIC_RULES: readonly DiagnosticRule[];
|
|
29
|
+
/**
|
|
30
|
+
Namespaced transport data. Payload is opaque and is never flattened or coerced.
|
|
31
|
+
*/
|
|
32
|
+
export interface SfmcDiagnosticData<T = unknown> {
|
|
33
|
+
sfmc: {
|
|
34
|
+
variant: DiagnosticVariant;
|
|
35
|
+
payload: T;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
Normalized input for existing quick-fix handlers.
|
|
40
|
+
*/
|
|
41
|
+
export interface DecodedDiagnosticData<T = unknown> {
|
|
42
|
+
variant: DiagnosticVariant;
|
|
43
|
+
payload: T;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Resolve an internal variant without accepting inherited object properties.
|
|
47
|
+
* @param variant - Internal variant identity.
|
|
48
|
+
* @returns The registry row, or undefined for an unknown identity.
|
|
49
|
+
*/
|
|
50
|
+
export declare function getDiagnosticRule(variant: string): DiagnosticRule | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Build an owning-package release link; development tags may not exist yet.
|
|
53
|
+
* @param variant - Internal variant identity.
|
|
54
|
+
* @returns An HTTPS link pinned to the LSP package version.
|
|
55
|
+
*/
|
|
56
|
+
export declare function getDiagnosticDocumentationUrl(variant: DiagnosticVariant): string;
|
|
57
|
+
/**
|
|
58
|
+
* Preserve primitive and object payloads under a namespaced envelope.
|
|
59
|
+
* @param variant - Exact internal check identity.
|
|
60
|
+
* @param payload - Original JSON-serializable diagnostic data, or undefined when absent.
|
|
61
|
+
* @returns The transport envelope without mutation or cloning of the payload.
|
|
62
|
+
*/
|
|
63
|
+
export declare function encodeDiagnosticData<T>(variant: DiagnosticVariant, payload: T): SfmcDiagnosticData<T>;
|
|
64
|
+
/**
|
|
65
|
+
* Decode legacy data or canonical envelopes into the same quick-fix input.
|
|
66
|
+
* Canonical many-to-one rules always require a matching explicit variant.
|
|
67
|
+
* Unnamed legacy diagnostics cannot be decoded without inventing an identity.
|
|
68
|
+
* @param code - Protocol diagnostic code (numeric third-party codes are ignored).
|
|
69
|
+
* @param data - Original diagnostic data or namespaced envelope.
|
|
70
|
+
* @returns Normalized input, or undefined for unknown, malformed or ambiguous codes.
|
|
71
|
+
*/
|
|
72
|
+
export declare function decodeDiagnosticData(code: string | number | undefined, data: unknown): DecodedDiagnosticData | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Attach the public identity and release documentation to a first-party emission.
|
|
75
|
+
* @param variant - Exact internal check identity, including formerly unnamed checks.
|
|
76
|
+
* @param diagnostic - Diagnostic content with the original opaque payload.
|
|
77
|
+
* @returns A new diagnostic carrying canonical metadata and a lossless envelope.
|
|
78
|
+
*/
|
|
79
|
+
export declare function createDiagnostic(variant: DiagnosticVariant, diagnostic: Omit<Diagnostic, 'code' | 'codeDescription'>): Diagnostic;
|
|
80
|
+
export { LSP_PACKAGE_VERSION } from './package-version.js';
|
|
81
|
+
//# sourceMappingURL=diagnostic-rules.d.ts.map
|
|
@@ -0,0 +1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