@typespec/prettier-plugin-typespec 0.63.0-dev.0 → 0.63.0-dev.1
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 +20 -20
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -436,12 +436,6 @@ const diagnostics = {
|
|
|
436
436
|
typeofTarget: "Typeof expects a value literal or value reference.",
|
|
437
437
|
},
|
|
438
438
|
},
|
|
439
|
-
"trailing-token": {
|
|
440
|
-
severity: "error",
|
|
441
|
-
messages: {
|
|
442
|
-
default: paramMessage `Trailing ${"token"}`,
|
|
443
|
-
},
|
|
444
|
-
},
|
|
445
439
|
"unknown-directive": {
|
|
446
440
|
severity: "error",
|
|
447
441
|
messages: {
|
|
@@ -1285,6 +1279,26 @@ const diagnostics = {
|
|
|
1285
1279
|
default: "Conflict marker encountered.",
|
|
1286
1280
|
},
|
|
1287
1281
|
},
|
|
1282
|
+
// #region Visibility
|
|
1283
|
+
"visibility-sealed": {
|
|
1284
|
+
severity: "error",
|
|
1285
|
+
messages: {
|
|
1286
|
+
default: paramMessage `Visibility of property '${"propName"}' is sealed and cannot be changed.`,
|
|
1287
|
+
},
|
|
1288
|
+
},
|
|
1289
|
+
"visibility-mixed-legacy": {
|
|
1290
|
+
severity: "error",
|
|
1291
|
+
messages: {
|
|
1292
|
+
default: "Cannot apply both string (legacy) visibility modifiers and enum-based visibility modifiers to a property.",
|
|
1293
|
+
},
|
|
1294
|
+
},
|
|
1295
|
+
"default-visibility-not-member": {
|
|
1296
|
+
severity: "error",
|
|
1297
|
+
messages: {
|
|
1298
|
+
default: "The default visibility modifiers of a class must be members of the class enum.",
|
|
1299
|
+
},
|
|
1300
|
+
},
|
|
1301
|
+
// #endregion
|
|
1288
1302
|
// #region CLI
|
|
1289
1303
|
"no-compatible-vs-installed": {
|
|
1290
1304
|
severity: "error",
|
|
@@ -3376,7 +3390,6 @@ var ListKind;
|
|
|
3376
3390
|
const PropertiesBase = {
|
|
3377
3391
|
allowEmpty: true,
|
|
3378
3392
|
toleratedDelimiterIsValid: true,
|
|
3379
|
-
trailingDelimiterIsValid: true,
|
|
3380
3393
|
allowedStatementKeyword: Token.None,
|
|
3381
3394
|
};
|
|
3382
3395
|
ListKind.OperationParameters = {
|
|
@@ -3442,7 +3455,6 @@ var ListKind;
|
|
|
3442
3455
|
delimiter: Token.Comma,
|
|
3443
3456
|
toleratedDelimiter: Token.Semicolon,
|
|
3444
3457
|
toleratedDelimiterIsValid: false,
|
|
3445
|
-
trailingDelimiterIsValid: false,
|
|
3446
3458
|
invalidAnnotationTarget: "expression",
|
|
3447
3459
|
allowedStatementKeyword: Token.None,
|
|
3448
3460
|
};
|
|
@@ -5929,22 +5941,10 @@ function createParser(code, options = {}) {
|
|
|
5929
5941
|
mutate(item).directives = directives;
|
|
5930
5942
|
}
|
|
5931
5943
|
r.items.push(item);
|
|
5932
|
-
const delimiter = token();
|
|
5933
|
-
const delimiterPos = tokenPos();
|
|
5934
5944
|
if (parseOptionalDelimiter(kind)) {
|
|
5935
5945
|
// Delimiter found: check if it's trailing.
|
|
5936
5946
|
if (parseOptional(kind.close)) {
|
|
5937
5947
|
mutate(r.range).end = previousTokenEnd;
|
|
5938
|
-
if (!kind.trailingDelimiterIsValid) {
|
|
5939
|
-
error({
|
|
5940
|
-
code: "trailing-token",
|
|
5941
|
-
format: { token: TokenDisplay[delimiter] },
|
|
5942
|
-
target: {
|
|
5943
|
-
pos: delimiterPos,
|
|
5944
|
-
end: delimiterPos + 1,
|
|
5945
|
-
},
|
|
5946
|
-
});
|
|
5947
|
-
}
|
|
5948
5948
|
// It was trailing and we've consumed the close token.
|
|
5949
5949
|
break;
|
|
5950
5950
|
}
|