@typespec/prettier-plugin-typespec 0.55.0-dev.1 → 0.56.0-dev.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/dist/index.js +40 -30
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -146,34 +146,35 @@ var SyntaxKind;
|
|
|
146
146
|
SyntaxKind[SyntaxKind["ProjectionParameterDeclaration"] = 60] = "ProjectionParameterDeclaration";
|
|
147
147
|
SyntaxKind[SyntaxKind["ProjectionModelSelector"] = 61] = "ProjectionModelSelector";
|
|
148
148
|
SyntaxKind[SyntaxKind["ProjectionModelPropertySelector"] = 62] = "ProjectionModelPropertySelector";
|
|
149
|
-
SyntaxKind[SyntaxKind["
|
|
150
|
-
SyntaxKind[SyntaxKind["
|
|
151
|
-
SyntaxKind[SyntaxKind["
|
|
152
|
-
SyntaxKind[SyntaxKind["
|
|
153
|
-
SyntaxKind[SyntaxKind["
|
|
154
|
-
SyntaxKind[SyntaxKind["
|
|
155
|
-
SyntaxKind[SyntaxKind["
|
|
156
|
-
SyntaxKind[SyntaxKind["
|
|
157
|
-
SyntaxKind[SyntaxKind["
|
|
158
|
-
SyntaxKind[SyntaxKind["
|
|
159
|
-
SyntaxKind[SyntaxKind["
|
|
160
|
-
SyntaxKind[SyntaxKind["
|
|
161
|
-
SyntaxKind[SyntaxKind["
|
|
162
|
-
SyntaxKind[SyntaxKind["
|
|
163
|
-
SyntaxKind[SyntaxKind["
|
|
164
|
-
SyntaxKind[SyntaxKind["
|
|
165
|
-
SyntaxKind[SyntaxKind["
|
|
166
|
-
SyntaxKind[SyntaxKind["
|
|
167
|
-
SyntaxKind[SyntaxKind["
|
|
168
|
-
SyntaxKind[SyntaxKind["
|
|
169
|
-
SyntaxKind[SyntaxKind["
|
|
170
|
-
SyntaxKind[SyntaxKind["
|
|
171
|
-
SyntaxKind[SyntaxKind["
|
|
172
|
-
SyntaxKind[SyntaxKind["
|
|
173
|
-
SyntaxKind[SyntaxKind["
|
|
174
|
-
SyntaxKind[SyntaxKind["
|
|
175
|
-
SyntaxKind[SyntaxKind["
|
|
176
|
-
SyntaxKind[SyntaxKind["
|
|
149
|
+
SyntaxKind[SyntaxKind["ProjectionScalarSelector"] = 63] = "ProjectionScalarSelector";
|
|
150
|
+
SyntaxKind[SyntaxKind["ProjectionOperationSelector"] = 64] = "ProjectionOperationSelector";
|
|
151
|
+
SyntaxKind[SyntaxKind["ProjectionUnionSelector"] = 65] = "ProjectionUnionSelector";
|
|
152
|
+
SyntaxKind[SyntaxKind["ProjectionUnionVariantSelector"] = 66] = "ProjectionUnionVariantSelector";
|
|
153
|
+
SyntaxKind[SyntaxKind["ProjectionInterfaceSelector"] = 67] = "ProjectionInterfaceSelector";
|
|
154
|
+
SyntaxKind[SyntaxKind["ProjectionEnumSelector"] = 68] = "ProjectionEnumSelector";
|
|
155
|
+
SyntaxKind[SyntaxKind["ProjectionEnumMemberSelector"] = 69] = "ProjectionEnumMemberSelector";
|
|
156
|
+
SyntaxKind[SyntaxKind["ProjectionExpressionStatement"] = 70] = "ProjectionExpressionStatement";
|
|
157
|
+
SyntaxKind[SyntaxKind["ProjectionIfExpression"] = 71] = "ProjectionIfExpression";
|
|
158
|
+
SyntaxKind[SyntaxKind["ProjectionBlockExpression"] = 72] = "ProjectionBlockExpression";
|
|
159
|
+
SyntaxKind[SyntaxKind["ProjectionMemberExpression"] = 73] = "ProjectionMemberExpression";
|
|
160
|
+
SyntaxKind[SyntaxKind["ProjectionLogicalExpression"] = 74] = "ProjectionLogicalExpression";
|
|
161
|
+
SyntaxKind[SyntaxKind["ProjectionEqualityExpression"] = 75] = "ProjectionEqualityExpression";
|
|
162
|
+
SyntaxKind[SyntaxKind["ProjectionUnaryExpression"] = 76] = "ProjectionUnaryExpression";
|
|
163
|
+
SyntaxKind[SyntaxKind["ProjectionRelationalExpression"] = 77] = "ProjectionRelationalExpression";
|
|
164
|
+
SyntaxKind[SyntaxKind["ProjectionArithmeticExpression"] = 78] = "ProjectionArithmeticExpression";
|
|
165
|
+
SyntaxKind[SyntaxKind["ProjectionCallExpression"] = 79] = "ProjectionCallExpression";
|
|
166
|
+
SyntaxKind[SyntaxKind["ProjectionLambdaExpression"] = 80] = "ProjectionLambdaExpression";
|
|
167
|
+
SyntaxKind[SyntaxKind["ProjectionLambdaParameterDeclaration"] = 81] = "ProjectionLambdaParameterDeclaration";
|
|
168
|
+
SyntaxKind[SyntaxKind["ProjectionModelExpression"] = 82] = "ProjectionModelExpression";
|
|
169
|
+
SyntaxKind[SyntaxKind["ProjectionModelProperty"] = 83] = "ProjectionModelProperty";
|
|
170
|
+
SyntaxKind[SyntaxKind["ProjectionModelSpreadProperty"] = 84] = "ProjectionModelSpreadProperty";
|
|
171
|
+
SyntaxKind[SyntaxKind["ProjectionSpreadProperty"] = 85] = "ProjectionSpreadProperty";
|
|
172
|
+
SyntaxKind[SyntaxKind["ProjectionTupleExpression"] = 86] = "ProjectionTupleExpression";
|
|
173
|
+
SyntaxKind[SyntaxKind["ProjectionStatement"] = 87] = "ProjectionStatement";
|
|
174
|
+
SyntaxKind[SyntaxKind["ProjectionDecoratorReferenceExpression"] = 88] = "ProjectionDecoratorReferenceExpression";
|
|
175
|
+
SyntaxKind[SyntaxKind["Return"] = 89] = "Return";
|
|
176
|
+
SyntaxKind[SyntaxKind["JsNamespaceDeclaration"] = 90] = "JsNamespaceDeclaration";
|
|
177
|
+
SyntaxKind[SyntaxKind["TemplateArgument"] = 91] = "TemplateArgument";
|
|
177
178
|
})(SyntaxKind || (SyntaxKind = {}));
|
|
178
179
|
var IdentifierKind;
|
|
179
180
|
(function (IdentifierKind) {
|
|
@@ -773,7 +774,7 @@ const diagnostics = {
|
|
|
773
774
|
shadow: {
|
|
774
775
|
severity: "warning",
|
|
775
776
|
messages: {
|
|
776
|
-
default: paramMessage `Shadowing parent template
|
|
777
|
+
default: paramMessage `Shadowing parent template parameter with the same name "${"name"}"`,
|
|
777
778
|
},
|
|
778
779
|
},
|
|
779
780
|
"invalid-deprecation-argument": {
|
|
@@ -4738,6 +4739,8 @@ path, options, print) {
|
|
|
4738
4739
|
return "model";
|
|
4739
4740
|
case SyntaxKind.ProjectionModelPropertySelector:
|
|
4740
4741
|
return "modelproperty";
|
|
4742
|
+
case SyntaxKind.ProjectionScalarSelector:
|
|
4743
|
+
return "scalar";
|
|
4741
4744
|
case SyntaxKind.ProjectionOperationSelector:
|
|
4742
4745
|
return "op";
|
|
4743
4746
|
case SyntaxKind.ProjectionUnionSelector:
|
|
@@ -7615,7 +7618,7 @@ function createParser(code, options = {}) {
|
|
|
7615
7618
|
}
|
|
7616
7619
|
function parseProjectionSelector() {
|
|
7617
7620
|
const pos = tokenPos();
|
|
7618
|
-
const selectorTok = expectTokenIsOneOf(Token.Identifier, Token.ModelKeyword, Token.OpKeyword, Token.InterfaceKeyword, Token.UnionKeyword, Token.EnumKeyword);
|
|
7621
|
+
const selectorTok = expectTokenIsOneOf(Token.Identifier, Token.ModelKeyword, Token.OpKeyword, Token.InterfaceKeyword, Token.UnionKeyword, Token.EnumKeyword, Token.ScalarKeyword);
|
|
7619
7622
|
switch (selectorTok) {
|
|
7620
7623
|
case Token.Identifier:
|
|
7621
7624
|
const id = parseIdentifierOrMemberExpression(undefined, true);
|
|
@@ -7669,6 +7672,12 @@ function createParser(code, options = {}) {
|
|
|
7669
7672
|
kind: SyntaxKind.ProjectionEnumSelector,
|
|
7670
7673
|
...finishNode(pos),
|
|
7671
7674
|
};
|
|
7675
|
+
case Token.ScalarKeyword:
|
|
7676
|
+
nextToken();
|
|
7677
|
+
return {
|
|
7678
|
+
kind: SyntaxKind.ProjectionScalarSelector,
|
|
7679
|
+
...finishNode(pos),
|
|
7680
|
+
};
|
|
7672
7681
|
default:
|
|
7673
7682
|
// recovery: return a missing identifier to use as the selector
|
|
7674
7683
|
// we don't need to emit a diagnostic here as the `expectTokenOneOf` above
|
|
@@ -8438,6 +8447,7 @@ function visitChildren(node, cb) {
|
|
|
8438
8447
|
case SyntaxKind.EmptyStatement:
|
|
8439
8448
|
case SyntaxKind.ProjectionModelSelector:
|
|
8440
8449
|
case SyntaxKind.ProjectionModelPropertySelector:
|
|
8450
|
+
case SyntaxKind.ProjectionScalarSelector:
|
|
8441
8451
|
case SyntaxKind.ProjectionUnionSelector:
|
|
8442
8452
|
case SyntaxKind.ProjectionUnionVariantSelector:
|
|
8443
8453
|
case SyntaxKind.ProjectionInterfaceSelector:
|