@typespec/compiler 0.66.0-dev.1 → 0.66.0-dev.3
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/dist/manifest.js +2 -2
- package/dist/src/core/compiler-code-fixes/triple-quote-indent.codefix.d.ts +3 -0
- package/dist/src/core/compiler-code-fixes/triple-quote-indent.codefix.d.ts.map +1 -0
- package/dist/src/core/compiler-code-fixes/triple-quote-indent.codefix.js +49 -0
- package/dist/src/core/compiler-code-fixes/triple-quote-indent.codefix.js.map +1 -0
- package/dist/src/core/helpers/syntax-utils.d.ts +1 -0
- package/dist/src/core/helpers/syntax-utils.d.ts.map +1 -1
- package/dist/src/core/helpers/syntax-utils.js +28 -0
- package/dist/src/core/helpers/syntax-utils.js.map +1 -1
- package/dist/src/core/messages.d.ts +2 -2
- package/dist/src/core/parser.d.ts.map +1 -1
- package/dist/src/core/parser.js +1 -1
- package/dist/src/core/parser.js.map +1 -1
- package/dist/src/core/scanner.d.ts.map +1 -1
- package/dist/src/core/scanner.js +13 -6
- package/dist/src/core/scanner.js.map +1 -1
- package/dist/src/experimental/typekit/define-kit.d.ts +1 -0
- package/dist/src/experimental/typekit/define-kit.d.ts.map +1 -1
- package/dist/src/experimental/typekit/define-kit.js +14 -1
- package/dist/src/experimental/typekit/define-kit.js.map +1 -1
- package/dist/src/experimental/typekit/index.d.ts.map +1 -1
- package/dist/src/experimental/typekit/index.js +9 -3
- package/dist/src/experimental/typekit/index.js.map +1 -1
- package/dist/src/experimental/typekit/kits/array.d.ts +28 -0
- package/dist/src/experimental/typekit/kits/array.d.ts.map +1 -0
- package/dist/src/experimental/typekit/kits/array.js +26 -0
- package/dist/src/experimental/typekit/kits/array.js.map +1 -0
- package/dist/src/experimental/typekit/kits/builtin.d.ts +117 -0
- package/dist/src/experimental/typekit/kits/builtin.d.ts.map +1 -0
- package/dist/src/experimental/typekit/kits/builtin.js +81 -0
- package/dist/src/experimental/typekit/kits/builtin.js.map +1 -0
- package/dist/src/experimental/typekit/kits/enum-member.d.ts +52 -0
- package/dist/src/experimental/typekit/kits/enum-member.d.ts.map +1 -0
- package/dist/src/experimental/typekit/kits/enum-member.js +22 -0
- package/dist/src/experimental/typekit/kits/enum-member.js.map +1 -0
- package/dist/src/experimental/typekit/kits/enum.d.ts +54 -0
- package/dist/src/experimental/typekit/kits/enum.d.ts.map +1 -0
- package/dist/src/experimental/typekit/kits/enum.js +47 -0
- package/dist/src/experimental/typekit/kits/enum.js.map +1 -0
- package/dist/src/experimental/typekit/kits/index.d.ts +7 -0
- package/dist/src/experimental/typekit/kits/index.d.ts.map +1 -1
- package/dist/src/experimental/typekit/kits/index.js +7 -0
- package/dist/src/experimental/typekit/kits/index.js.map +1 -1
- package/dist/src/experimental/typekit/kits/model-property.d.ts +29 -1
- package/dist/src/experimental/typekit/kits/model-property.d.ts.map +1 -1
- package/dist/src/experimental/typekit/kits/model-property.js +11 -0
- package/dist/src/experimental/typekit/kits/model-property.js.map +1 -1
- package/dist/src/experimental/typekit/kits/model.d.ts +29 -4
- package/dist/src/experimental/typekit/kits/model.d.ts.map +1 -1
- package/dist/src/experimental/typekit/kits/model.js +49 -2
- package/dist/src/experimental/typekit/kits/model.js.map +1 -1
- package/dist/src/experimental/typekit/kits/operation.d.ts +49 -0
- package/dist/src/experimental/typekit/kits/operation.d.ts.map +1 -0
- package/dist/src/experimental/typekit/kits/operation.js +28 -0
- package/dist/src/experimental/typekit/kits/operation.js.map +1 -0
- package/dist/src/experimental/typekit/kits/record.d.ts +33 -0
- package/dist/src/experimental/typekit/kits/record.d.ts.map +1 -0
- package/dist/src/experimental/typekit/kits/record.js +26 -0
- package/dist/src/experimental/typekit/kits/record.js.map +1 -0
- package/dist/src/experimental/typekit/kits/type.d.ts +93 -1
- package/dist/src/experimental/typekit/kits/type.d.ts.map +1 -1
- package/dist/src/experimental/typekit/kits/type.js +67 -0
- package/dist/src/experimental/typekit/kits/type.js.map +1 -1
- package/dist/src/experimental/typekit/kits/union-variant.d.ts +5 -1
- package/dist/src/experimental/typekit/kits/union-variant.d.ts.map +1 -1
- package/dist/src/experimental/typekit/kits/union-variant.js.map +1 -1
- package/dist/src/experimental/typekit/kits/union.d.ts +15 -1
- package/dist/src/experimental/typekit/kits/union.d.ts.map +1 -1
- package/dist/src/experimental/typekit/kits/union.js +7 -0
- package/dist/src/experimental/typekit/kits/union.js.map +1 -1
- package/dist/src/experimental/typekit/kits/value.d.ts +84 -0
- package/dist/src/experimental/typekit/kits/value.d.ts.map +1 -0
- package/dist/src/experimental/typekit/kits/value.js +81 -0
- package/dist/src/experimental/typekit/kits/value.js.map +1 -0
- package/dist/src/experimental/typekit/utils/get-plausible-name.d.ts +7 -0
- package/dist/src/experimental/typekit/utils/get-plausible-name.d.ts.map +1 -0
- package/dist/src/experimental/typekit/utils/get-plausible-name.js +17 -0
- package/dist/src/experimental/typekit/utils/get-plausible-name.js.map +1 -0
- package/dist/src/experimental/typekit/utils/index.d.ts +2 -0
- package/dist/src/experimental/typekit/utils/index.d.ts.map +1 -0
- package/dist/src/experimental/typekit/utils/index.js +2 -0
- package/dist/src/experimental/typekit/utils/index.js.map +1 -0
- package/dist/src/formatter/print/printer.d.ts.map +1 -1
- package/dist/src/formatter/print/printer.js +1 -29
- package/dist/src/formatter/print/printer.js.map +1 -1
- package/package.json +1 -1
- package/templates/scaffolding.json +4 -4
package/dist/manifest.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triple-quote-indent.codefix.d.ts","sourceRoot":"","sources":["../../../../src/core/compiler-code-fixes/triple-quote-indent.codefix.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,cAAc,iCA8DtE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { isWhiteSpaceSingleLine } from "../charcode.js";
|
|
2
|
+
import { defineCodeFix } from "../diagnostics.js";
|
|
3
|
+
import { splitLines } from "../helpers/syntax-utils.js";
|
|
4
|
+
export function createTripleQuoteIndentCodeFix(location) {
|
|
5
|
+
return defineCodeFix({
|
|
6
|
+
id: "triple-quote-indent",
|
|
7
|
+
label: "Format triple-quote-indent",
|
|
8
|
+
fix: (context) => {
|
|
9
|
+
const splitStr = "\n";
|
|
10
|
+
const tripleQuote = '"""';
|
|
11
|
+
const tripleQuoteLen = tripleQuote.length;
|
|
12
|
+
const text = location.file.text.slice(location.pos + tripleQuoteLen, location.end - tripleQuoteLen);
|
|
13
|
+
const lines = splitLines(text);
|
|
14
|
+
if (lines.length === 0) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (lines.length === 1) {
|
|
18
|
+
const indentNumb = getIndentNumbInLine(lines[0]);
|
|
19
|
+
const prefix = " ".repeat(indentNumb);
|
|
20
|
+
return context.replaceText(location, [tripleQuote, lines[0], `${prefix}${tripleQuote}`].join(splitStr));
|
|
21
|
+
}
|
|
22
|
+
if (lines[0].trim() === "") {
|
|
23
|
+
lines.shift();
|
|
24
|
+
}
|
|
25
|
+
const lastLine = lines[lines.length - 1];
|
|
26
|
+
if (lastLine.trim() === "") {
|
|
27
|
+
lines.pop();
|
|
28
|
+
}
|
|
29
|
+
let prefix = "";
|
|
30
|
+
const minIndentNumb = Math.min(...lines.map((line) => getIndentNumbInLine(line)));
|
|
31
|
+
const lastLineIndentNumb = getIndentNumbInLine(lastLine);
|
|
32
|
+
if (minIndentNumb < lastLineIndentNumb) {
|
|
33
|
+
const indentDiff = lastLineIndentNumb - minIndentNumb;
|
|
34
|
+
prefix = " ".repeat(indentDiff);
|
|
35
|
+
}
|
|
36
|
+
const middle = lines.map((line) => `${prefix}${line}`).join(splitStr);
|
|
37
|
+
return context.replaceText(location, `${tripleQuote}${splitStr}${middle}${splitStr}${" ".repeat(lastLineIndentNumb)}${tripleQuote}`);
|
|
38
|
+
function getIndentNumbInLine(lineText) {
|
|
39
|
+
let curStart = 0;
|
|
40
|
+
while (curStart < lineText.length &&
|
|
41
|
+
isWhiteSpaceSingleLine(lineText.charCodeAt(curStart))) {
|
|
42
|
+
curStart++;
|
|
43
|
+
}
|
|
44
|
+
return curStart;
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=triple-quote-indent.codefix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triple-quote-indent.codefix.js","sourceRoot":"","sources":["../../../../src/core/compiler-code-fixes/triple-quote-indent.codefix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAGxD,MAAM,UAAU,8BAA8B,CAAC,QAAwB;IACrE,OAAO,aAAa,CAAC;QACnB,EAAE,EAAE,qBAAqB;QACzB,KAAK,EAAE,4BAA4B;QACnC,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE;YACf,MAAM,QAAQ,GAAG,IAAI,CAAC;YACtB,MAAM,WAAW,GAAG,KAAK,CAAC;YAC1B,MAAM,cAAc,GAAG,WAAW,CAAC,MAAM,CAAC;YAC1C,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CACnC,QAAQ,CAAC,GAAG,GAAG,cAAc,EAC7B,QAAQ,CAAC,GAAG,GAAG,cAAc,CAC9B,CAAC;YAEF,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;YAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACvB,OAAO;YACT,CAAC;YAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACvB,MAAM,UAAU,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBACj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,GAAG,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,GAAG,WAAW,EAAE,CAC/F,CAAC;YAEF,SAAS,mBAAmB,CAAC,QAAgB;gBAC3C,IAAI,QAAQ,GAAG,CAAC,CAAC;gBACjB,OACE,QAAQ,GAAG,QAAQ,CAAC,MAAM;oBAC1B,sBAAsB,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,EACrD,CAAC;oBACD,QAAQ,EAAE,CAAC;gBACb,CAAC;gBACD,OAAO,QAAQ,CAAC;YAClB,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -12,4 +12,5 @@ import { IdentifierNode, MemberExpressionNode, TypeReferenceNode } from "../type
|
|
|
12
12
|
*/
|
|
13
13
|
export declare function printIdentifier(sv: string): string;
|
|
14
14
|
export declare function typeReferenceToString(node: TypeReferenceNode | MemberExpressionNode | IdentifierNode): string;
|
|
15
|
+
export declare function splitLines(text: string): string[];
|
|
15
16
|
//# sourceMappingURL=syntax-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syntax-utils.d.ts","sourceRoot":"","sources":["../../../../src/core/helpers/syntax-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAc,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAElG;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,UAYzC;AAoBD,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,iBAAiB,GAAG,oBAAoB,GAAG,cAAc,GAC9D,MAAM,CASR"}
|
|
1
|
+
{"version":3,"file":"syntax-utils.d.ts","sourceRoot":"","sources":["../../../../src/core/helpers/syntax-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAc,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAElG;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,UAYzC;AAoBD,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,iBAAiB,GAAG,oBAAoB,GAAG,cAAc,GAC9D,MAAM,CASR;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CA4BjD"}
|
|
@@ -53,4 +53,32 @@ export function typeReferenceToString(node) {
|
|
|
53
53
|
return node.sv;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
+
export function splitLines(text) {
|
|
57
|
+
const lines = [];
|
|
58
|
+
let start = 0;
|
|
59
|
+
let pos = 0;
|
|
60
|
+
while (pos < text.length) {
|
|
61
|
+
const ch = text.charCodeAt(pos);
|
|
62
|
+
switch (ch) {
|
|
63
|
+
case 13 /* CharCode.CarriageReturn */:
|
|
64
|
+
if (text.charCodeAt(pos + 1) === 10 /* CharCode.LineFeed */) {
|
|
65
|
+
lines.push(text.slice(start, pos));
|
|
66
|
+
start = pos + 2;
|
|
67
|
+
pos++;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
lines.push(text.slice(start, pos));
|
|
71
|
+
start = pos + 1;
|
|
72
|
+
}
|
|
73
|
+
break;
|
|
74
|
+
case 10 /* CharCode.LineFeed */:
|
|
75
|
+
lines.push(text.slice(start, pos));
|
|
76
|
+
start = pos + 1;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
pos++;
|
|
80
|
+
}
|
|
81
|
+
lines.push(text.slice(start));
|
|
82
|
+
return lines;
|
|
83
|
+
}
|
|
56
84
|
//# sourceMappingURL=syntax-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syntax-utils.js","sourceRoot":"","sources":["../../../../src/core/helpers/syntax-utils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"syntax-utils.js","sourceRoot":"","sources":["../../../../src/core/helpers/syntax-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,oBAAoB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CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;gBACnC,KAAK,GAAG,GAAG,GAAG,CAAC,CAAC;gBAChB,MAAM;QACV,CAAC;QACD,GAAG,EAAE,CAAC;IACR,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9B,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1015,7 +1015,7 @@ declare const diagnostics: {
|
|
|
1015
1015
|
};
|
|
1016
1016
|
};
|
|
1017
1017
|
export type CompilerDiagnostics = TypeOfDiagnostics<typeof diagnostics>;
|
|
1018
|
-
export declare const createDiagnostic: <C extends "digit-expected" | "hex-digit-expected" | "binary-digit-expected" | "unterminated" | "creating-file" | "invalid-escape-sequence" | "no-new-line-start-triple-quote" | "no-new-line-end-triple-quote" | "
|
|
1018
|
+
export declare const createDiagnostic: <C extends "triple-quote-indent" | "digit-expected" | "hex-digit-expected" | "binary-digit-expected" | "unterminated" | "creating-file" | "invalid-escape-sequence" | "no-new-line-start-triple-quote" | "no-new-line-end-triple-quote" | "invalid-character" | "file-not-found" | "file-load" | "init-template-invalid-json" | "init-template-download-failed" | "multiple-blockless-namespace" | "blockless-namespace-first" | "import-first" | "token-expected" | "unknown-directive" | "augment-decorator-target" | "duplicate-decorator" | "decorator-conflict" | "reserved-identifier" | "invalid-directive-location" | "invalid-decorator-location" | "invalid-projection" | "default-required" | "invalid-template-argument-name" | "invalid-template-default" | "required-parameter-first" | "rest-parameter-last" | "rest-parameter-required" | "doc-invalid-identifier" | "using-invalid-ref" | "invalid-type-ref" | "invalid-template-args" | "intersect-non-model" | "intersect-invalid-index" | "incompatible-indexer" | "no-array-properties" | "intersect-duplicate-property" | "invalid-decorator" | "invalid-ref" | "duplicate-property" | "override-property-mismatch" | "extend-scalar" | "extend-model" | "is-model" | "is-operation" | "spread-model" | "unsupported-default" | "spread-object" | "expect-value" | "non-callable" | "named-init-required" | "invalid-primitive-init" | "ambiguous-scalar-type" | "unassignable" | "property-unassignable" | "property-required" | "value-in-type" | "no-prop" | "missing-index" | "missing-property" | "unexpected-property" | "extends-interface" | "extends-interface-duplicate" | "interface-duplicate" | "union-duplicate" | "enum-member-duplicate" | "constructor-duplicate" | "spread-enum" | "decorator-fail" | "rest-parameter-array" | "decorator-extern" | "function-extern" | "missing-implementation" | "overload-same-parent" | "shadow" | "invalid-deprecation-argument" | "duplicate-deprecation" | "config-invalid-argument" | "config-circular-variable" | "config-path-absolute" | "config-invalid-name" | "path-unix-style" | "config-path-not-found" | "dynamic-import" | "invalid-import" | "invalid-main" | "import-not-found" | "library-invalid" | "incompatible-library" | "compiler-version-mismatch" | "duplicate-symbol" | "decorator-decl-target" | "mixed-string-template" | "non-literal-string-template" | "ambiguous-symbol" | "duplicate-using" | "on-validate-fail" | "invalid-emitter" | "js-error" | "missing-import" | "invalid-rule-ref" | "unknown-rule" | "unknown-rule-set" | "rule-enabled-disabled" | "format-failed" | "invalid-pattern-regex" | "decorator-wrong-target" | "invalid-argument" | "invalid-argument-count" | "known-values-invalid-enum" | "invalid-value" | "deprecated" | "no-optional-key" | "invalid-discriminated-union" | "invalid-discriminated-union-variant" | "missing-discriminator-property" | "invalid-discriminator-value" | "invalid-encode" | "invalid-mime-type" | "no-mime-type-suffix" | "encoded-name-conflict" | "incompatible-paging-props" | "invalid-paging-prop" | "duplicate-paging-prop" | "missing-paging-items" | "service-decorator-duplicate" | "list-type-not-model" | "invalid-range" | "add-response" | "add-parameter" | "add-model-property" | "add-model-property-fail" | "add-response-type" | "circular-base-type" | "circular-constraint" | "circular-op-signature" | "circular-alias-type" | "circular-const" | "circular-prop" | "conflict-marker" | "visibility-sealed" | "visibility-mixed-legacy" | "default-visibility-not-member" | "no-compatible-vs-installed" | "vs-extension-windows-only" | "vscode-in-path", M extends keyof {
|
|
1019
1019
|
"digit-expected": {
|
|
1020
1020
|
readonly default: "Digit expected.";
|
|
1021
1021
|
};
|
|
@@ -2047,7 +2047,7 @@ export declare const createDiagnostic: <C extends "digit-expected" | "hex-digit-
|
|
|
2047
2047
|
readonly default: "Couldn't find VS Code 'code' command in PATH. Make sure you have the VS Code executable added to the system PATH.";
|
|
2048
2048
|
readonly osx: "Couldn't find VS Code 'code' command in PATH. Make sure you have the VS Code executable added to the system PATH.\nSee instruction for Mac OS here https://code.visualstudio.com/docs/setup/mac";
|
|
2049
2049
|
};
|
|
2050
|
-
}, C, M>) => import("./types.js").Diagnostic, reportDiagnostic: <C extends "digit-expected" | "hex-digit-expected" | "binary-digit-expected" | "unterminated" | "creating-file" | "invalid-escape-sequence" | "no-new-line-start-triple-quote" | "no-new-line-end-triple-quote" | "
|
|
2050
|
+
}, C, M>) => import("./types.js").Diagnostic, reportDiagnostic: <C extends "triple-quote-indent" | "digit-expected" | "hex-digit-expected" | "binary-digit-expected" | "unterminated" | "creating-file" | "invalid-escape-sequence" | "no-new-line-start-triple-quote" | "no-new-line-end-triple-quote" | "invalid-character" | "file-not-found" | "file-load" | "init-template-invalid-json" | "init-template-download-failed" | "multiple-blockless-namespace" | "blockless-namespace-first" | "import-first" | "token-expected" | "unknown-directive" | "augment-decorator-target" | "duplicate-decorator" | "decorator-conflict" | "reserved-identifier" | "invalid-directive-location" | "invalid-decorator-location" | "invalid-projection" | "default-required" | "invalid-template-argument-name" | "invalid-template-default" | "required-parameter-first" | "rest-parameter-last" | "rest-parameter-required" | "doc-invalid-identifier" | "using-invalid-ref" | "invalid-type-ref" | "invalid-template-args" | "intersect-non-model" | "intersect-invalid-index" | "incompatible-indexer" | "no-array-properties" | "intersect-duplicate-property" | "invalid-decorator" | "invalid-ref" | "duplicate-property" | "override-property-mismatch" | "extend-scalar" | "extend-model" | "is-model" | "is-operation" | "spread-model" | "unsupported-default" | "spread-object" | "expect-value" | "non-callable" | "named-init-required" | "invalid-primitive-init" | "ambiguous-scalar-type" | "unassignable" | "property-unassignable" | "property-required" | "value-in-type" | "no-prop" | "missing-index" | "missing-property" | "unexpected-property" | "extends-interface" | "extends-interface-duplicate" | "interface-duplicate" | "union-duplicate" | "enum-member-duplicate" | "constructor-duplicate" | "spread-enum" | "decorator-fail" | "rest-parameter-array" | "decorator-extern" | "function-extern" | "missing-implementation" | "overload-same-parent" | "shadow" | "invalid-deprecation-argument" | "duplicate-deprecation" | "config-invalid-argument" | "config-circular-variable" | "config-path-absolute" | "config-invalid-name" | "path-unix-style" | "config-path-not-found" | "dynamic-import" | "invalid-import" | "invalid-main" | "import-not-found" | "library-invalid" | "incompatible-library" | "compiler-version-mismatch" | "duplicate-symbol" | "decorator-decl-target" | "mixed-string-template" | "non-literal-string-template" | "ambiguous-symbol" | "duplicate-using" | "on-validate-fail" | "invalid-emitter" | "js-error" | "missing-import" | "invalid-rule-ref" | "unknown-rule" | "unknown-rule-set" | "rule-enabled-disabled" | "format-failed" | "invalid-pattern-regex" | "decorator-wrong-target" | "invalid-argument" | "invalid-argument-count" | "known-values-invalid-enum" | "invalid-value" | "deprecated" | "no-optional-key" | "invalid-discriminated-union" | "invalid-discriminated-union-variant" | "missing-discriminator-property" | "invalid-discriminator-value" | "invalid-encode" | "invalid-mime-type" | "no-mime-type-suffix" | "encoded-name-conflict" | "incompatible-paging-props" | "invalid-paging-prop" | "duplicate-paging-prop" | "missing-paging-items" | "service-decorator-duplicate" | "list-type-not-model" | "invalid-range" | "add-response" | "add-parameter" | "add-model-property" | "add-model-property-fail" | "add-response-type" | "circular-base-type" | "circular-constraint" | "circular-op-signature" | "circular-alias-type" | "circular-const" | "circular-prop" | "conflict-marker" | "visibility-sealed" | "visibility-mixed-legacy" | "default-visibility-not-member" | "no-compatible-vs-installed" | "vs-extension-windows-only" | "vscode-in-path", M extends keyof {
|
|
2051
2051
|
"digit-expected": {
|
|
2052
2052
|
readonly default: "Digit expected.";
|
|
2053
2053
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../src/core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.js";
|
|
3
3
|
import { compilerAssert } from "./diagnostics.js";
|
|
4
4
|
import { createDiagnostic } from "./messages.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createScanner, isComment, isKeyword, isPunctuation, isStatementKeyword, isTrivia, skipContinuousIdentifier, skipTrivia, skipTriviaBackward, Token, TokenDisplay, TokenFlags, } from "./scanner.js";
|
|
6
6
|
import { IdentifierKind, SyntaxKind, } from "./types.js";
|
|
7
7
|
/**
|
|
8
8
|
* The fixed set of options for each of the kinds of delimited lists in TypeSpec.
|