@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 CHANGED
@@ -1,4 +1,4 @@
1
1
  export default {
2
- "version": "1.9.0-dev.0",
3
- "commit": "9964d3c5b526b1c95d2afba07a66725d76ebd27e"
2
+ "version": "1.9.0-dev.2",
3
+ "commit": "2b36c0b0a9cc7c945f6d15b39e86915da9e87978"
4
4
  };
@@ -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
- reportDeprecation(program, target, deprecationDetails.message, reportCheckerDiagnostic);
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
- reportDeprecation(program, target, deprecationDetails.message, reportCheckerDiagnostic);
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
- reportDeprecation(program, decApp.node ?? target, deprecation.message, program.reportDiagnostic);
4975
+ reportDeprecated(program, deprecation.message, decApp.node ?? target);
4987
4976
  }
4988
4977
  }
4989
4978
  // peel `fn` off to avoid setting `this`.