typescript 5.0.0-dev.20221208 → 5.0.0-dev.20221210

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.
@@ -85,6 +85,12 @@ declare namespace Intl {
85
85
  style?: ListFormatStyle | undefined;
86
86
  }
87
87
 
88
+ interface ResolvedListFormatOptions {
89
+ locale: string;
90
+ style: ListFormatStyle;
91
+ type: ListFormatType;
92
+ }
93
+
88
94
  interface ListFormat {
89
95
  /**
90
96
  * Returns a string with a language-specific representation of the list.
@@ -111,6 +117,15 @@ declare namespace Intl {
111
117
  * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/formatToParts).
112
118
  */
113
119
  formatToParts(list: Iterable<string>): { type: "element" | "literal", value: string; }[];
120
+
121
+ /**
122
+ * Returns a new object with properties reflecting the locale and style
123
+ * formatting options computed during the construction of the current
124
+ * `Intl.ListFormat` object.
125
+ *
126
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/resolvedOptions).
127
+ */
128
+ resolvedOptions(): ResolvedListFormatOptions;
114
129
  }
115
130
 
116
131
  const ListFormat: {
package/lib/tsc.js CHANGED
@@ -23,7 +23,7 @@ var __export = (target, all) => {
23
23
 
24
24
  // src/compiler/corePublic.ts
25
25
  var versionMajorMinor = "5.0";
26
- var version = `${versionMajorMinor}.0-dev.20221208`;
26
+ var version = `${versionMajorMinor}.0-dev.20221210`;
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -14662,7 +14662,8 @@ function getSetExternalModuleIndicator(options) {
14662
14662
  }
14663
14663
  }
14664
14664
  function getEmitScriptTarget(compilerOptions) {
14665
- return compilerOptions.target || compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 0 /* ES3 */;
14665
+ var _a2;
14666
+ return (_a2 = compilerOptions.target) != null ? _a2 : compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */;
14666
14667
  }
14667
14668
  function getEmitModuleKind(compilerOptions) {
14668
14669
  return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
@@ -30096,7 +30097,7 @@ var targetOptionDeclaration = {
30096
30097
  showInSimplifiedHelpView: true,
30097
30098
  category: Diagnostics.Language_and_Environment,
30098
30099
  description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
30099
- defaultValueDescription: 0 /* ES3 */
30100
+ defaultValueDescription: 1 /* ES5 */
30100
30101
  };
30101
30102
  var moduleOptionDeclaration = {
30102
30103
  name: "module",
@@ -34519,7 +34520,7 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
34519
34520
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
34520
34521
  return createResolvedModuleWithFailedLookupLocations(
34521
34522
  resolved && resolved.value,
34522
- false,
34523
+ (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path),
34523
34524
  failedLookupLocations,
34524
34525
  affectingLocations,
34525
34526
  diagnostics,
@@ -45049,7 +45050,8 @@ function createTypeChecker(host) {
45049
45050
  const elementType = checkIteratedTypeOrElementType(65 /* Destructuring */ | (declaration.dotDotDotToken ? 0 : 128 /* PossiblyOutOfBounds */), parentType, undefinedType, pattern);
45050
45051
  const index = pattern.elements.indexOf(declaration);
45051
45052
  if (declaration.dotDotDotToken) {
45052
- type = everyType(parentType, isTupleType) ? mapType(parentType, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
45053
+ const baseConstraint = getBaseConstraintOrType(parentType);
45054
+ type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
45053
45055
  } else if (isArrayLikeType(parentType)) {
45054
45056
  const indexType = getNumberLiteralType(index);
45055
45057
  const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
@@ -98670,7 +98672,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
98670
98672
  }
98671
98673
  function getDiagnosticsHelper(sourceFile, getDiagnostics, cancellationToken) {
98672
98674
  if (sourceFile) {
98673
- return getDiagnostics(sourceFile, cancellationToken);
98675
+ return sortAndDeduplicateDiagnostics(getDiagnostics(sourceFile, cancellationToken));
98674
98676
  }
98675
98677
  return sortAndDeduplicateDiagnostics(flatMap(program.getSourceFiles(), (sourceFile2) => {
98676
98678
  if (cancellationToken) {
package/lib/tsserver.js CHANGED
@@ -2645,7 +2645,7 @@ __export(ts_server_exports3, {
2645
2645
 
2646
2646
  // src/compiler/corePublic.ts
2647
2647
  var versionMajorMinor = "5.0";
2648
- var version = `${versionMajorMinor}.0-dev.20221208`;
2648
+ var version = `${versionMajorMinor}.0-dev.20221210`;
2649
2649
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2650
2650
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2651
2651
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -19103,7 +19103,8 @@ function getSetExternalModuleIndicator(options) {
19103
19103
  }
19104
19104
  }
19105
19105
  function getEmitScriptTarget(compilerOptions) {
19106
- return compilerOptions.target || compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 0 /* ES3 */;
19106
+ var _a2;
19107
+ return (_a2 = compilerOptions.target) != null ? _a2 : compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */;
19107
19108
  }
19108
19109
  function getEmitModuleKind(compilerOptions) {
19109
19110
  return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
@@ -34757,7 +34758,7 @@ var targetOptionDeclaration = {
34757
34758
  showInSimplifiedHelpView: true,
34758
34759
  category: Diagnostics.Language_and_Environment,
34759
34760
  description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
34760
- defaultValueDescription: 0 /* ES3 */
34761
+ defaultValueDescription: 1 /* ES5 */
34761
34762
  };
34762
34763
  var moduleOptionDeclaration = {
34763
34764
  name: "module",
@@ -39329,7 +39330,7 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
39329
39330
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
39330
39331
  return createResolvedModuleWithFailedLookupLocations(
39331
39332
  resolved && resolved.value,
39332
- false,
39333
+ (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path),
39333
39334
  failedLookupLocations,
39334
39335
  affectingLocations,
39335
39336
  diagnostics,
@@ -49908,7 +49909,8 @@ function createTypeChecker(host) {
49908
49909
  const elementType = checkIteratedTypeOrElementType(65 /* Destructuring */ | (declaration.dotDotDotToken ? 0 : 128 /* PossiblyOutOfBounds */), parentType, undefinedType, pattern);
49909
49910
  const index = pattern.elements.indexOf(declaration);
49910
49911
  if (declaration.dotDotDotToken) {
49911
- type = everyType(parentType, isTupleType) ? mapType(parentType, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
49912
+ const baseConstraint = getBaseConstraintOrType(parentType);
49913
+ type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
49912
49914
  } else if (isArrayLikeType(parentType)) {
49913
49915
  const indexType = getNumberLiteralType(index);
49914
49916
  const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
@@ -103755,7 +103757,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
103755
103757
  }
103756
103758
  function getDiagnosticsHelper(sourceFile, getDiagnostics2, cancellationToken) {
103757
103759
  if (sourceFile) {
103758
- return getDiagnostics2(sourceFile, cancellationToken);
103760
+ return sortAndDeduplicateDiagnostics(getDiagnostics2(sourceFile, cancellationToken));
103759
103761
  }
103760
103762
  return sortAndDeduplicateDiagnostics(flatMap(program.getSourceFiles(), (sourceFile2) => {
103761
103763
  if (cancellationToken) {
@@ -121609,7 +121611,8 @@ var invalidOperationsInPartialSemanticMode = [
121609
121611
  "prepareCallHierarchy",
121610
121612
  "provideCallHierarchyIncomingCalls",
121611
121613
  "provideCallHierarchyOutgoingCalls",
121612
- "provideInlayHints"
121614
+ "provideInlayHints",
121615
+ "getSupportedCodeFixes"
121613
121616
  ];
121614
121617
  var invalidOperationsInSyntacticMode = [
121615
121618
  ...invalidOperationsInPartialSemanticMode,
@@ -122706,7 +122709,8 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
122706
122709
  toggleMultilineComment,
122707
122710
  commentSelection,
122708
122711
  uncommentSelection,
122709
- provideInlayHints: provideInlayHints2
122712
+ provideInlayHints: provideInlayHints2,
122713
+ getSupportedCodeFixes
122710
122714
  };
122711
122715
  switch (languageServiceMode) {
122712
122716
  case 0 /* Semantic */:
@@ -133959,7 +133963,7 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
133959
133963
  source = "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */;
133960
133964
  sortText = SortText.SortBelow(sortText);
133961
133965
  }
133962
- if (isJsxIdentifierExpected && !isRightOfOpenTag && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") {
133966
+ if (isJsxIdentifierExpected && !isRightOfOpenTag && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none" && !(isJsxAttribute(location.parent) && location.parent.initializer)) {
133963
133967
  let useBraces2 = preferences.jsxAttributeCompletionStyle === "braces";
133964
133968
  const type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
133965
133969
  if (preferences.jsxAttributeCompletionStyle === "auto" && !(type.flags & 528 /* BooleanLike */) && !(type.flags & 1048576 /* Union */ && find(type.types, (type2) => !!(type2.flags & 528 /* BooleanLike */)))) {
@@ -135033,6 +135037,9 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
135033
135037
  const typeExpression = isJSDocTemplateTag(tag) ? tag.constraint : tag.typeExpression;
135034
135038
  return typeExpression && typeExpression.kind === 312 /* JSDocTypeExpression */ ? typeExpression : void 0;
135035
135039
  }
135040
+ if (isJSDocAugmentsTag(tag) || isJSDocImplementsTag(tag)) {
135041
+ return tag.class;
135042
+ }
135036
135043
  return void 0;
135037
135044
  }
135038
135045
  function getTypeScriptMemberSymbols() {
@@ -140558,6 +140565,7 @@ function organizeImports(sourceFile, formatContext, host, program, preferences,
140558
140565
  const newImportDecls = flatMap(sortedImportGroups, (importGroup) => getExternalModuleName2(importGroup[0].moduleSpecifier) ? coalesce(importGroup) : importGroup);
140559
140566
  if (newImportDecls.length === 0) {
140560
140567
  changeTracker.deleteNodes(sourceFile, oldImportDecls, {
140568
+ leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude,
140561
140569
  trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Include
140562
140570
  }, true);
140563
140571
  } else {
@@ -158707,8 +158715,8 @@ var Session3 = class {
158707
158715
  [CommandNames.ApplyCodeActionCommand]: (request) => {
158708
158716
  return this.requiredResponse(this.applyCodeActionCommand(request.arguments));
158709
158717
  },
158710
- [CommandNames.GetSupportedCodeFixes]: () => {
158711
- return this.requiredResponse(this.getSupportedCodeFixes());
158718
+ [CommandNames.GetSupportedCodeFixes]: (request) => {
158719
+ return this.requiredResponse(this.getSupportedCodeFixes(request.arguments));
158712
158720
  },
158713
158721
  [CommandNames.GetApplicableRefactors]: (request) => {
158714
158722
  return this.requiredResponse(this.getApplicableRefactors(request.arguments));
@@ -160194,8 +160202,17 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
160194
160202
  return a.containerKind === b.containerKind && a.containerName === b.containerName && a.fileName === b.fileName && a.isCaseSensitive === b.isCaseSensitive && a.kind === b.kind && a.kindModifiers === b.kindModifiers && a.matchKind === b.matchKind && a.name === b.name && a.textSpan.start === b.textSpan.start && a.textSpan.length === b.textSpan.length;
160195
160203
  }
160196
160204
  }
160197
- getSupportedCodeFixes() {
160198
- return getSupportedCodeFixes();
160205
+ getSupportedCodeFixes(args) {
160206
+ if (!args)
160207
+ return getSupportedCodeFixes();
160208
+ if (args.file) {
160209
+ const { file, project: project2 } = this.getFileAndProject(args);
160210
+ return project2.getLanguageService().getSupportedCodeFixes(file);
160211
+ }
160212
+ const project = this.getProject(args.projectFileName);
160213
+ if (!project)
160214
+ Errors.ThrowNoProject();
160215
+ return project.getLanguageService().getSupportedCodeFixes();
160199
160216
  }
160200
160217
  isLocation(locationOrSpan) {
160201
160218
  return locationOrSpan.line !== void 0;
@@ -691,6 +691,7 @@ declare namespace ts {
691
691
  */
692
692
  interface GetSupportedCodeFixesRequest extends Request {
693
693
  command: CommandTypes.GetSupportedCodeFixes;
694
+ arguments?: Partial<FileRequestArgs>;
694
695
  }
695
696
  /**
696
697
  * A response for GetSupportedCodeFixesRequest request.
@@ -10051,6 +10052,7 @@ declare namespace ts {
10051
10052
  toggleMultilineComment(fileName: string, textRange: TextRange): TextChange[];
10052
10053
  commentSelection(fileName: string, textRange: TextRange): TextChange[];
10053
10054
  uncommentSelection(fileName: string, textRange: TextRange): TextChange[];
10055
+ getSupportedCodeFixes(fileName?: string): readonly string[];
10054
10056
  dispose(): void;
10055
10057
  }
10056
10058
  interface JsxClosingTagInfo {
@@ -11033,7 +11035,7 @@ declare namespace ts {
11033
11035
  function toEditorSettings(options: EditorOptions | EditorSettings): EditorSettings;
11034
11036
  function displayPartsToString(displayParts: SymbolDisplayPart[] | undefined): string;
11035
11037
  function getDefaultCompilerOptions(): CompilerOptions;
11036
- function getSupportedCodeFixes(): string[];
11038
+ function getSupportedCodeFixes(): readonly string[];
11037
11039
  function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTargetOrOptions: ScriptTarget | CreateSourceFileOptions, version: string, setNodeParents: boolean, scriptKind?: ScriptKind): SourceFile;
11038
11040
  function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange | undefined, aggressiveChecks?: boolean): SourceFile;
11039
11041
  function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry, syntaxOnlyOrLanguageServiceMode?: boolean | LanguageServiceMode): LanguageService;
@@ -42,7 +42,7 @@ var ts = (() => {
42
42
  "src/compiler/corePublic.ts"() {
43
43
  "use strict";
44
44
  versionMajorMinor = "5.0";
45
- version = `${versionMajorMinor}.0-dev.20221208`;
45
+ version = `${versionMajorMinor}.0-dev.20221210`;
46
46
  Comparison = /* @__PURE__ */ ((Comparison3) => {
47
47
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
48
48
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -16478,7 +16478,8 @@ ${lanes.join("\n")}
16478
16478
  }
16479
16479
  }
16480
16480
  function getEmitScriptTarget(compilerOptions) {
16481
- return compilerOptions.target || compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 0 /* ES3 */;
16481
+ var _a2;
16482
+ return (_a2 = compilerOptions.target) != null ? _a2 : compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */;
16482
16483
  }
16483
16484
  function getEmitModuleKind(compilerOptions) {
16484
16485
  return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
@@ -33874,7 +33875,7 @@ ${lanes.join("\n")}
33874
33875
  showInSimplifiedHelpView: true,
33875
33876
  category: Diagnostics.Language_and_Environment,
33876
33877
  description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
33877
- defaultValueDescription: 0 /* ES3 */
33878
+ defaultValueDescription: 1 /* ES5 */
33878
33879
  };
33879
33880
  moduleOptionDeclaration = {
33880
33881
  name: "module",
@@ -36864,7 +36865,7 @@ ${lanes.join("\n")}
36864
36865
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
36865
36866
  return createResolvedModuleWithFailedLookupLocations(
36866
36867
  resolved && resolved.value,
36867
- false,
36868
+ (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path),
36868
36869
  failedLookupLocations,
36869
36870
  affectingLocations,
36870
36871
  diagnostics,
@@ -47369,7 +47370,8 @@ ${lanes.join("\n")}
47369
47370
  const elementType = checkIteratedTypeOrElementType(65 /* Destructuring */ | (declaration.dotDotDotToken ? 0 : 128 /* PossiblyOutOfBounds */), parentType, undefinedType, pattern);
47370
47371
  const index = pattern.elements.indexOf(declaration);
47371
47372
  if (declaration.dotDotDotToken) {
47372
- type = everyType(parentType, isTupleType) ? mapType(parentType, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
47373
+ const baseConstraint = getBaseConstraintOrType(parentType);
47374
+ type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
47373
47375
  } else if (isArrayLikeType(parentType)) {
47374
47376
  const indexType = getNumberLiteralType(index);
47375
47377
  const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
@@ -101419,7 +101421,7 @@ ${lanes.join("\n")}
101419
101421
  }
101420
101422
  function getDiagnosticsHelper(sourceFile, getDiagnostics2, cancellationToken) {
101421
101423
  if (sourceFile) {
101422
- return getDiagnostics2(sourceFile, cancellationToken);
101424
+ return sortAndDeduplicateDiagnostics(getDiagnostics2(sourceFile, cancellationToken));
101423
101425
  }
101424
101426
  return sortAndDeduplicateDiagnostics(flatMap(program.getSourceFiles(), (sourceFile2) => {
101425
101427
  if (cancellationToken) {
@@ -117528,7 +117530,8 @@ ${lanes.join("\n")}
117528
117530
  toggleMultilineComment,
117529
117531
  commentSelection,
117530
117532
  uncommentSelection,
117531
- provideInlayHints: provideInlayHints2
117533
+ provideInlayHints: provideInlayHints2,
117534
+ getSupportedCodeFixes
117532
117535
  };
117533
117536
  switch (languageServiceMode) {
117534
117537
  case 0 /* Semantic */:
@@ -118270,7 +118273,8 @@ ${lanes.join("\n")}
118270
118273
  "prepareCallHierarchy",
118271
118274
  "provideCallHierarchyIncomingCalls",
118272
118275
  "provideCallHierarchyOutgoingCalls",
118273
- "provideInlayHints"
118276
+ "provideInlayHints",
118277
+ "getSupportedCodeFixes"
118274
118278
  ];
118275
118279
  invalidOperationsInSyntacticMode = [
118276
118280
  ...invalidOperationsInPartialSemanticMode,
@@ -130062,7 +130066,7 @@ ${lanes.join("\n")}
130062
130066
  source = "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */;
130063
130067
  sortText = SortText.SortBelow(sortText);
130064
130068
  }
130065
- if (isJsxIdentifierExpected && !isRightOfOpenTag && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") {
130069
+ if (isJsxIdentifierExpected && !isRightOfOpenTag && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none" && !(isJsxAttribute(location.parent) && location.parent.initializer)) {
130066
130070
  let useBraces2 = preferences.jsxAttributeCompletionStyle === "braces";
130067
130071
  const type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
130068
130072
  if (preferences.jsxAttributeCompletionStyle === "auto" && !(type.flags & 528 /* BooleanLike */) && !(type.flags & 1048576 /* Union */ && find(type.types, (type2) => !!(type2.flags & 528 /* BooleanLike */)))) {
@@ -131119,6 +131123,9 @@ ${lanes.join("\n")}
131119
131123
  const typeExpression = isJSDocTemplateTag(tag) ? tag.constraint : tag.typeExpression;
131120
131124
  return typeExpression && typeExpression.kind === 312 /* JSDocTypeExpression */ ? typeExpression : void 0;
131121
131125
  }
131126
+ if (isJSDocAugmentsTag(tag) || isJSDocImplementsTag(tag)) {
131127
+ return tag.class;
131128
+ }
131122
131129
  return void 0;
131123
131130
  }
131124
131131
  function getTypeScriptMemberSymbols() {
@@ -136794,6 +136801,7 @@ ${lanes.join("\n")}
136794
136801
  const newImportDecls = flatMap(sortedImportGroups, (importGroup) => getExternalModuleName2(importGroup[0].moduleSpecifier) ? coalesce(importGroup) : importGroup);
136795
136802
  if (newImportDecls.length === 0) {
136796
136803
  changeTracker.deleteNodes(sourceFile, oldImportDecls, {
136804
+ leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude,
136797
136805
  trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Include
136798
136806
  }, true);
136799
136807
  } else {
@@ -155558,8 +155566,8 @@ ${json}${newLine}`;
155558
155566
  [CommandNames.ApplyCodeActionCommand]: (request) => {
155559
155567
  return this.requiredResponse(this.applyCodeActionCommand(request.arguments));
155560
155568
  },
155561
- [CommandNames.GetSupportedCodeFixes]: () => {
155562
- return this.requiredResponse(this.getSupportedCodeFixes());
155569
+ [CommandNames.GetSupportedCodeFixes]: (request) => {
155570
+ return this.requiredResponse(this.getSupportedCodeFixes(request.arguments));
155563
155571
  },
155564
155572
  [CommandNames.GetApplicableRefactors]: (request) => {
155565
155573
  return this.requiredResponse(this.getApplicableRefactors(request.arguments));
@@ -157045,8 +157053,17 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
157045
157053
  return a.containerKind === b.containerKind && a.containerName === b.containerName && a.fileName === b.fileName && a.isCaseSensitive === b.isCaseSensitive && a.kind === b.kind && a.kindModifiers === b.kindModifiers && a.matchKind === b.matchKind && a.name === b.name && a.textSpan.start === b.textSpan.start && a.textSpan.length === b.textSpan.length;
157046
157054
  }
157047
157055
  }
157048
- getSupportedCodeFixes() {
157049
- return getSupportedCodeFixes();
157056
+ getSupportedCodeFixes(args) {
157057
+ if (!args)
157058
+ return getSupportedCodeFixes();
157059
+ if (args.file) {
157060
+ const { file, project: project2 } = this.getFileAndProject(args);
157061
+ return project2.getLanguageService().getSupportedCodeFixes(file);
157062
+ }
157063
+ const project = this.getProject(args.projectFileName);
157064
+ if (!project)
157065
+ Errors.ThrowNoProject();
157066
+ return project.getLanguageService().getSupportedCodeFixes();
157050
157067
  }
157051
157068
  isLocation(locationOrSpan) {
157052
157069
  return locationOrSpan.line !== void 0;
@@ -6191,6 +6191,7 @@ declare namespace ts {
6191
6191
  toggleMultilineComment(fileName: string, textRange: TextRange): TextChange[];
6192
6192
  commentSelection(fileName: string, textRange: TextRange): TextChange[];
6193
6193
  uncommentSelection(fileName: string, textRange: TextRange): TextChange[];
6194
+ getSupportedCodeFixes(fileName?: string): readonly string[];
6194
6195
  dispose(): void;
6195
6196
  }
6196
6197
  interface JsxClosingTagInfo {
@@ -7173,7 +7174,7 @@ declare namespace ts {
7173
7174
  function toEditorSettings(options: EditorOptions | EditorSettings): EditorSettings;
7174
7175
  function displayPartsToString(displayParts: SymbolDisplayPart[] | undefined): string;
7175
7176
  function getDefaultCompilerOptions(): CompilerOptions;
7176
- function getSupportedCodeFixes(): string[];
7177
+ function getSupportedCodeFixes(): readonly string[];
7177
7178
  function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTargetOrOptions: ScriptTarget | CreateSourceFileOptions, version: string, setNodeParents: boolean, scriptKind?: ScriptKind): SourceFile;
7178
7179
  function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange | undefined, aggressiveChecks?: boolean): SourceFile;
7179
7180
  function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry, syntaxOnlyOrLanguageServiceMode?: boolean | LanguageServiceMode): LanguageService;
package/lib/typescript.js CHANGED
@@ -42,7 +42,7 @@ var ts = (() => {
42
42
  "src/compiler/corePublic.ts"() {
43
43
  "use strict";
44
44
  versionMajorMinor = "5.0";
45
- version = `${versionMajorMinor}.0-dev.20221208`;
45
+ version = `${versionMajorMinor}.0-dev.20221210`;
46
46
  Comparison = /* @__PURE__ */ ((Comparison3) => {
47
47
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
48
48
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -16478,7 +16478,8 @@ ${lanes.join("\n")}
16478
16478
  }
16479
16479
  }
16480
16480
  function getEmitScriptTarget(compilerOptions) {
16481
- return compilerOptions.target || compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 0 /* ES3 */;
16481
+ var _a2;
16482
+ return (_a2 = compilerOptions.target) != null ? _a2 : compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */;
16482
16483
  }
16483
16484
  function getEmitModuleKind(compilerOptions) {
16484
16485
  return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
@@ -33874,7 +33875,7 @@ ${lanes.join("\n")}
33874
33875
  showInSimplifiedHelpView: true,
33875
33876
  category: Diagnostics.Language_and_Environment,
33876
33877
  description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
33877
- defaultValueDescription: 0 /* ES3 */
33878
+ defaultValueDescription: 1 /* ES5 */
33878
33879
  };
33879
33880
  moduleOptionDeclaration = {
33880
33881
  name: "module",
@@ -36864,7 +36865,7 @@ ${lanes.join("\n")}
36864
36865
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
36865
36866
  return createResolvedModuleWithFailedLookupLocations(
36866
36867
  resolved && resolved.value,
36867
- false,
36868
+ (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path),
36868
36869
  failedLookupLocations,
36869
36870
  affectingLocations,
36870
36871
  diagnostics,
@@ -47369,7 +47370,8 @@ ${lanes.join("\n")}
47369
47370
  const elementType = checkIteratedTypeOrElementType(65 /* Destructuring */ | (declaration.dotDotDotToken ? 0 : 128 /* PossiblyOutOfBounds */), parentType, undefinedType, pattern);
47370
47371
  const index = pattern.elements.indexOf(declaration);
47371
47372
  if (declaration.dotDotDotToken) {
47372
- type = everyType(parentType, isTupleType) ? mapType(parentType, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
47373
+ const baseConstraint = getBaseConstraintOrType(parentType);
47374
+ type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
47373
47375
  } else if (isArrayLikeType(parentType)) {
47374
47376
  const indexType = getNumberLiteralType(index);
47375
47377
  const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
@@ -101419,7 +101421,7 @@ ${lanes.join("\n")}
101419
101421
  }
101420
101422
  function getDiagnosticsHelper(sourceFile, getDiagnostics2, cancellationToken) {
101421
101423
  if (sourceFile) {
101422
- return getDiagnostics2(sourceFile, cancellationToken);
101424
+ return sortAndDeduplicateDiagnostics(getDiagnostics2(sourceFile, cancellationToken));
101423
101425
  }
101424
101426
  return sortAndDeduplicateDiagnostics(flatMap(program.getSourceFiles(), (sourceFile2) => {
101425
101427
  if (cancellationToken) {
@@ -117542,7 +117544,8 @@ ${lanes.join("\n")}
117542
117544
  toggleMultilineComment,
117543
117545
  commentSelection,
117544
117546
  uncommentSelection,
117545
- provideInlayHints: provideInlayHints2
117547
+ provideInlayHints: provideInlayHints2,
117548
+ getSupportedCodeFixes
117546
117549
  };
117547
117550
  switch (languageServiceMode) {
117548
117551
  case 0 /* Semantic */:
@@ -118284,7 +118287,8 @@ ${lanes.join("\n")}
118284
118287
  "prepareCallHierarchy",
118285
118288
  "provideCallHierarchyIncomingCalls",
118286
118289
  "provideCallHierarchyOutgoingCalls",
118287
- "provideInlayHints"
118290
+ "provideInlayHints",
118291
+ "getSupportedCodeFixes"
118288
118292
  ];
118289
118293
  invalidOperationsInSyntacticMode = [
118290
118294
  ...invalidOperationsInPartialSemanticMode,
@@ -130076,7 +130080,7 @@ ${lanes.join("\n")}
130076
130080
  source = "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */;
130077
130081
  sortText = SortText.SortBelow(sortText);
130078
130082
  }
130079
- if (isJsxIdentifierExpected && !isRightOfOpenTag && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") {
130083
+ if (isJsxIdentifierExpected && !isRightOfOpenTag && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none" && !(isJsxAttribute(location.parent) && location.parent.initializer)) {
130080
130084
  let useBraces2 = preferences.jsxAttributeCompletionStyle === "braces";
130081
130085
  const type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
130082
130086
  if (preferences.jsxAttributeCompletionStyle === "auto" && !(type.flags & 528 /* BooleanLike */) && !(type.flags & 1048576 /* Union */ && find(type.types, (type2) => !!(type2.flags & 528 /* BooleanLike */)))) {
@@ -131133,6 +131137,9 @@ ${lanes.join("\n")}
131133
131137
  const typeExpression = isJSDocTemplateTag(tag) ? tag.constraint : tag.typeExpression;
131134
131138
  return typeExpression && typeExpression.kind === 312 /* JSDocTypeExpression */ ? typeExpression : void 0;
131135
131139
  }
131140
+ if (isJSDocAugmentsTag(tag) || isJSDocImplementsTag(tag)) {
131141
+ return tag.class;
131142
+ }
131136
131143
  return void 0;
131137
131144
  }
131138
131145
  function getTypeScriptMemberSymbols() {
@@ -136808,6 +136815,7 @@ ${lanes.join("\n")}
136808
136815
  const newImportDecls = flatMap(sortedImportGroups, (importGroup) => getExternalModuleName2(importGroup[0].moduleSpecifier) ? coalesce(importGroup) : importGroup);
136809
136816
  if (newImportDecls.length === 0) {
136810
136817
  changeTracker.deleteNodes(sourceFile, oldImportDecls, {
136818
+ leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude,
136811
136819
  trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Include
136812
136820
  }, true);
136813
136821
  } else {
@@ -50,7 +50,7 @@ var path = __toESM(require("path"));
50
50
 
51
51
  // src/compiler/corePublic.ts
52
52
  var versionMajorMinor = "5.0";
53
- var version = `${versionMajorMinor}.0-dev.20221208`;
53
+ var version = `${versionMajorMinor}.0-dev.20221210`;
54
54
 
55
55
  // src/compiler/core.ts
56
56
  var emptyArray = [];
@@ -11135,7 +11135,8 @@ function getLanguageVariant(scriptKind) {
11135
11135
  return scriptKind === 4 /* TSX */ || scriptKind === 2 /* JSX */ || scriptKind === 1 /* JS */ || scriptKind === 6 /* JSON */ ? 1 /* JSX */ : 0 /* Standard */;
11136
11136
  }
11137
11137
  function getEmitScriptTarget(compilerOptions) {
11138
- return compilerOptions.target || compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 0 /* ES3 */;
11138
+ var _a2;
11139
+ return (_a2 = compilerOptions.target) != null ? _a2 : compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */;
11139
11140
  }
11140
11141
  function getEmitModuleKind(compilerOptions) {
11141
11142
  return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
@@ -24275,7 +24276,7 @@ var targetOptionDeclaration = {
24275
24276
  showInSimplifiedHelpView: true,
24276
24277
  category: Diagnostics.Language_and_Environment,
24277
24278
  description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
24278
- defaultValueDescription: 0 /* ES3 */
24279
+ defaultValueDescription: 1 /* ES5 */
24279
24280
  };
24280
24281
  var moduleOptionDeclaration = {
24281
24282
  name: "module",
@@ -26989,7 +26990,7 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
26989
26990
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
26990
26991
  return createResolvedModuleWithFailedLookupLocations(
26991
26992
  resolved && resolved.value,
26992
- false,
26993
+ (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path),
26993
26994
  failedLookupLocations,
26994
26995
  affectingLocations,
26995
26996
  diagnostics,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.0.0-dev.20221208",
5
+ "version": "5.0.0-dev.20221210",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -86,6 +86,7 @@
86
86
  "build": "npm run build:compiler && npm run build:tests",
87
87
  "build:compiler": "hereby local",
88
88
  "build:tests": "hereby tests",
89
+ "build:tests:notypecheck": "hereby tests --no-typecheck",
89
90
  "start": "node lib/tsc",
90
91
  "clean": "hereby clean",
91
92
  "gulp": "hereby",