@typespec/compiler 1.9.0-dev.0 → 1.9.0-dev.2
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/checker.js +4 -15
- package/dist/src/core/checker.js.map +1 -1
- package/dist/src/core/cli/actions/compile/args.d.ts.map +1 -1
- package/dist/src/core/cli/actions/compile/args.js +3 -0
- package/dist/src/core/cli/actions/compile/args.js.map +1 -1
- package/dist/src/core/diagnostics.d.ts +2 -1
- package/dist/src/core/diagnostics.d.ts.map +1 -1
- package/dist/src/core/diagnostics.js +13 -7
- package/dist/src/core/diagnostics.js.map +1 -1
- package/dist/src/server/serverlib.d.ts.map +1 -1
- package/dist/src/server/serverlib.js +1 -1
- package/dist/src/server/serverlib.js.map +1 -1
- package/package.json +1 -1
package/dist/manifest.js
CHANGED
package/dist/src/core/checker.js
CHANGED
|
@@ -7,7 +7,7 @@ import { createSymbol, getSymNode } from "./binder.js";
|
|
|
7
7
|
import { createChangeIdentifierCodeFix } from "./compiler-code-fixes/change-identifier.codefix.js";
|
|
8
8
|
import { createModelToObjectValueCodeFix, createTupleToArrayValueCodeFix, } from "./compiler-code-fixes/convert-to-value.codefix.js";
|
|
9
9
|
import { getDeprecationDetails, markDeprecated } from "./deprecation.js";
|
|
10
|
-
import { compilerAssert, ignoreDiagnostics } from "./diagnostics.js";
|
|
10
|
+
import { compilerAssert, ignoreDiagnostics, reportDeprecated } from "./diagnostics.js";
|
|
11
11
|
import { validateInheritanceDiscriminatedUnions } from "./helpers/discriminator-utils.js";
|
|
12
12
|
import { explainStringTemplateNotSerializable } from "./helpers/string-template-utils.js";
|
|
13
13
|
import { typeReferenceToString } from "./helpers/syntax-utils.js";
|
|
@@ -659,13 +659,13 @@ export function createChecker(program, resolver) {
|
|
|
659
659
|
if (node) {
|
|
660
660
|
const deprecationDetails = getDeprecationDetails(program, node);
|
|
661
661
|
if (deprecationDetails) {
|
|
662
|
-
|
|
662
|
+
reportDeprecated(program, deprecationDetails.message, target, reportCheckerDiagnostic);
|
|
663
663
|
return;
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
666
|
const deprecationDetails = getDeprecationDetails(program, type);
|
|
667
667
|
if (deprecationDetails) {
|
|
668
|
-
|
|
668
|
+
reportDeprecated(program, deprecationDetails.message, target, reportCheckerDiagnostic);
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
671
|
function isTypeReferenceContextDeprecated(node) {
|
|
@@ -4960,17 +4960,6 @@ function getDocContent(content) {
|
|
|
4960
4960
|
}
|
|
4961
4961
|
return docs.join("");
|
|
4962
4962
|
}
|
|
4963
|
-
function reportDeprecation(program, target, message, reportFunc) {
|
|
4964
|
-
if (program.compilerOptions.ignoreDeprecated !== true) {
|
|
4965
|
-
reportFunc(createDiagnostic({
|
|
4966
|
-
code: "deprecated",
|
|
4967
|
-
format: {
|
|
4968
|
-
message,
|
|
4969
|
-
},
|
|
4970
|
-
target,
|
|
4971
|
-
}));
|
|
4972
|
-
}
|
|
4973
|
-
}
|
|
4974
4963
|
function applyDecoratorToType(program, decApp, target) {
|
|
4975
4964
|
compilerAssert("decorators" in target, "Cannot apply decorator to non-decoratable type", target);
|
|
4976
4965
|
for (const arg of decApp.args) {
|
|
@@ -4983,7 +4972,7 @@ function applyDecoratorToType(program, decApp, target) {
|
|
|
4983
4972
|
if (decApp.definition) {
|
|
4984
4973
|
const deprecation = getDeprecationDetails(program, decApp.definition);
|
|
4985
4974
|
if (deprecation !== undefined) {
|
|
4986
|
-
|
|
4975
|
+
reportDeprecated(program, deprecation.message, decApp.node ?? target);
|
|
4987
4976
|
}
|
|
4988
4977
|
}
|
|
4989
4978
|
// peel `fn` off to avoid setting `this`.
|