sfmc-language-lsp 4.3.1 → 4.4.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.
Files changed (41) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/data/ampscript.cjs +2 -1
  3. package/dist/cjs/data/ampscript.d.ts +1 -1
  4. package/dist/cjs/data/ampscript.d.ts.map +1 -1
  5. package/dist/cjs/data/ampscript.js.map +1 -1
  6. package/dist/cjs/diagnostic-rules.cjs +12 -0
  7. package/dist/cjs/diagnostic-rules.d.ts +1 -1
  8. package/dist/cjs/diagnostic-rules.d.ts.map +1 -1
  9. package/dist/cjs/diagnostic-rules.js.map +1 -1
  10. package/dist/cjs/package-version.cjs +1 -1
  11. package/dist/cjs/utils/regions.cjs +88 -30
  12. package/dist/cjs/utils/regions.d.ts +27 -0
  13. package/dist/cjs/utils/regions.d.ts.map +1 -1
  14. package/dist/cjs/utils/regions.js.map +1 -1
  15. package/dist/cjs/validators/ampscript.cjs +119 -98
  16. package/dist/cjs/validators/ampscript.d.ts.map +1 -1
  17. package/dist/cjs/validators/ampscript.js.map +1 -1
  18. package/dist/esm/data/ampscript.d.ts +1 -1
  19. package/dist/esm/data/ampscript.d.ts.map +1 -1
  20. package/dist/esm/data/ampscript.js +1 -1
  21. package/dist/esm/data/ampscript.js.map +1 -1
  22. package/dist/esm/diagnostic-rules.d.ts +1 -1
  23. package/dist/esm/diagnostic-rules.d.ts.map +1 -1
  24. package/dist/esm/diagnostic-rules.js +12 -0
  25. package/dist/esm/diagnostic-rules.js.map +1 -1
  26. package/dist/esm/package-version.js +1 -1
  27. package/dist/esm/utils/regions.d.ts +27 -0
  28. package/dist/esm/utils/regions.d.ts.map +1 -1
  29. package/dist/esm/utils/regions.js +87 -30
  30. package/dist/esm/utils/regions.js.map +1 -1
  31. package/dist/esm/validators/ampscript.d.ts.map +1 -1
  32. package/dist/esm/validators/ampscript.js +122 -101
  33. package/dist/esm/validators/ampscript.js.map +1 -1
  34. package/dist/types/data/ampscript.d.ts +1 -1
  35. package/dist/types/data/ampscript.d.ts.map +1 -1
  36. package/dist/types/diagnostic-rules.d.ts +1 -1
  37. package/dist/types/diagnostic-rules.d.ts.map +1 -1
  38. package/dist/types/utils/regions.d.ts +27 -0
  39. package/dist/types/utils/regions.d.ts.map +1 -1
  40. package/dist/types/validators/ampscript.d.ts.map +1 -1
  41. package/package.json +1 -1
@@ -6,7 +6,7 @@
6
6
  * and examples in this file are original content for this extension.
7
7
  */
8
8
  import { type AmpscriptDataFunction } from 'ampscript-data';
9
- export { FUNCTIONS as canonicalFunctions, FUNCTION_CANONICAL_MAP, functionNames, isEmailExcluded, isMcnSupported, getMcnApiVersion, getMcnNotes, AMPSCRIPT_KEYWORDS as ampscriptKeywords, AMPSCRIPT_OPERATORS as ampscriptOperators, AMPSCRIPT_GLOBALS as ampscriptGlobals, PERSONALIZATION_STRINGS as personalizationStrings, } from 'ampscript-data';
9
+ export { FUNCTIONS as canonicalFunctions, FUNCTION_CANONICAL_MAP, functionNames, isEmailExcluded, isMcnSupported, isSystemPersonalizationString, getMcnApiVersion, getMcnNotes, AMPSCRIPT_KEYWORDS as ampscriptKeywords, AMPSCRIPT_OPERATORS as ampscriptOperators, AMPSCRIPT_GLOBALS as ampscriptGlobals, PERSONALIZATION_STRINGS as personalizationStrings, } from 'ampscript-data';
10
10
  export type { AmpscriptDataFunction, AmpscriptDataParam, AmpscriptDataRepeatGroup, AmpscriptDataKeyword, AmpscriptDataOperator, AmpscriptDataGlobal, AmpscriptDataPersonalization, } from 'ampscript-data';
11
11
  export type AmpscriptFunction = AmpscriptDataFunction;
12
12
  export type AmpscriptFunctionParam = AmpscriptDataFunction['params'][number];
@@ -1 +1 @@
1
- {"version":3,"file":"ampscript.d.ts","sourceRoot":"","sources":["../../../src/data/ampscript.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAa,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvE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xB,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AACtD,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,qBAAqB,EAAc,CAAC;AAErE;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc,oCAAuC,CAAC"}
@@ -2,7 +2,7 @@ import type { Diagnostic } from './types.js';
2
2
  /**
3
3
  Explicit variant identities, including names reserved for formerly unnamed sites.
4
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/prefer-boolean-literal", "amp-prefer-boolean-literal", 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]];
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/prefer-boolean-literal", "amp-prefer-boolean-literal", 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/system-personalization-before-delimiter", "amp-no-ambiguous-personalization-delimiter", true, false], readonly ["ampscript/personalization-before-delimiter", "amp-no-ambiguous-personalization-delimiter", true, 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
6
  export type DiagnosticVariant = (typeof definitions)[number][0];
7
7
  export type DiagnosticRuleId = `sfmc/${(typeof definitions)[number][1]}`;
8
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostic-rules.d.ts","sourceRoot":"","sources":["../../src/diagnostic-rules.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;GAEG;AACH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,EAWrD,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,OAAO;IAC3C,IAAI,EAAE;QAAE,OAAO,EAAE,iBAAiB,CAAC;QAAC,OAAO,EAAE,CAAC,CAAA;KAAE,CAAC;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB,CAAC,CAAC,GAAG,OAAO;IAC9C,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,CAAC,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAE7E;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAIhF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAClC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,CAAC,GACX,kBAAkB,CAAC,CAAC,CAAC,CAGvB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAChC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EACjC,IAAI,EAAE,OAAO,GACd,qBAAqB,GAAG,SAAS,CAqBnC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC5B,OAAO,EAAE,iBAAiB,EAC1B,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB,CAAC,GACzD,UAAU,CASZ;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -50,6 +50,33 @@ export declare function getScriptRegions(text: string): ScriptRegion[];
50
50
  * @returns Offset-preserving text and retained block metadata.
51
51
  */
52
52
  export declare function extractScriptBodies(text: string, kinds: readonly ScriptKind[]): ScriptExtraction;
53
+ /**
54
+ One delimiter-level item found by {@link scanAmpscriptDelimiters}. Offsets are
55
+ UTF-16, zero-based, and end-exclusive.
56
+ - `block` / `inline`: `closed` regions span opener through closing delimiter; an
57
+ unclosed one covers only its three-character opener.
58
+ - `personalization`: a complete `%%name%%` string (plain text, never a delimiter).
59
+ - `block-close` / `inline-close`: a stray `]%%` / `=%%` outside any region.
60
+ */
61
+ export interface AmpscriptDelimiterRegion {
62
+ kind: 'block' | 'inline' | 'personalization' | 'block-close' | 'inline-close';
63
+ start: number;
64
+ end: number;
65
+ closed: boolean;
66
+ }
67
+ /**
68
+ * Scan a template left to right for AMPscript delimiters. At a `%%` outside any
69
+ * region, `%%[` opens a block ending at the first following `]%%` and `%%=` opens
70
+ * an inline expression ending at the first following `=%%`; otherwise a
71
+ * personalisation string (`%%name%%` on one line) is skipped as a whole, so neither
72
+ * of its `%%` can form a delimiter; any other `%%` is literal text. Scanning
73
+ * resumes right after an opener that has no closing delimiter. Outside a region,
74
+ * the body of a `<script runat="server">` that is not `language="ampscript"` is
75
+ * skipped up to its `</script` (or the end of the text).
76
+ * @param text - Full document text.
77
+ * @returns Regions, personalisation strings and stray closers in document order.
78
+ */
79
+ export declare function scanAmpscriptDelimiters(text: string): AmpscriptDelimiterRegion[];
53
80
  /**
54
81
  * Returns true when the given character offset falls inside an AMPscript
55
82
  * region: a %%[...]%% block, a %%=...=%% inline expression, or a
@@ -1 +1 @@
1
- {"version":3,"file":"regions.d.ts","sourceRoot":"","sources":["../../../src/utils/regions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,MAAM,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,QAAQ,CAAC;AAEhG;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,MAAM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AAE,YAA+B,GAC1C,UAAU,EAAE,CA+kBd;AAID,MAAM,WAAW,iBAAiB;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACf;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAmB/E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sfmc-language-lsp",
3
- "version": "4.3.1",
3
+ "version": "4.4.0",
4
4
  "type": "module",
5
5
  "description": "Protocol-agnostic, browser-compatible language service for Salesforce Marketing Cloud — AMPscript, SSJS, and GTL. Provides validation, completions, hover, signature help, and code actions.",
6
6
  "author": "Jörn Berkefeld",