typescript 5.1.0-dev.20230419 → 5.1.0-dev.20230421

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.
@@ -501,6 +501,14 @@ declare namespace ts {
501
501
  type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs & {
502
502
  triggerReason?: RefactorTriggerReason;
503
503
  kind?: string;
504
+ /**
505
+ * Include refactor actions that require additional arguments to be passed when
506
+ * calling 'GetEditsForRefactor'. When true, clients should inspect the
507
+ * `isInteractive` property of each returned `RefactorActionInfo`
508
+ * and ensure they are able to collect the appropriate arguments for any
509
+ * interactive refactor before offering it.
510
+ */
511
+ includeInteractiveActions?: boolean;
504
512
  };
505
513
  type RefactorTriggerReason = "implicit" | "invoked";
506
514
  /**
@@ -557,6 +565,11 @@ declare namespace ts {
557
565
  * The hierarchical dotted name of the refactor action.
558
566
  */
559
567
  kind?: string;
568
+ /**
569
+ * Indicates that the action requires additional arguments to be passed
570
+ * when calling 'GetEditsForRefactor'.
571
+ */
572
+ isInteractive?: boolean;
560
573
  }
561
574
  interface GetEditsForRefactorRequest extends Request {
562
575
  command: CommandTypes.GetEditsForRefactor;
@@ -3241,7 +3254,7 @@ declare namespace ts {
3241
3254
  private readonly cancellationToken;
3242
3255
  isNonTsProject(): boolean;
3243
3256
  isJsOnlyProject(): boolean;
3244
- static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void, logErrors?: (message: string) => void): {} | undefined;
3257
+ static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void): {} | undefined;
3245
3258
  isKnownTypesPackageName(name: string): boolean;
3246
3259
  installPackage(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
3247
3260
  private get typingsCache();
@@ -3328,9 +3341,8 @@ declare namespace ts {
3328
3341
  setTypeAcquisition(newTypeAcquisition: TypeAcquisition | undefined): void;
3329
3342
  getTypeAcquisition(): ts.TypeAcquisition;
3330
3343
  protected removeRoot(info: ScriptInfo): void;
3331
- protected enableGlobalPlugins(options: CompilerOptions, pluginConfigOverrides: Map<string, any> | undefined): void;
3332
- protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[], pluginConfigOverrides: Map<string, any> | undefined): void;
3333
- private enableProxy;
3344
+ protected enableGlobalPlugins(options: CompilerOptions): void;
3345
+ protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[]): void;
3334
3346
  /** Starts a new check for diagnostics. Call this if some file has updated that would cause diagnostics to be changed. */
3335
3347
  refreshDiagnostics(): void;
3336
3348
  }
@@ -3631,7 +3643,6 @@ declare namespace ts {
3631
3643
  readonly globalPlugins: readonly string[];
3632
3644
  readonly pluginProbeLocations: readonly string[];
3633
3645
  readonly allowLocalPluginLoads: boolean;
3634
- private currentPluginConfigOverrides;
3635
3646
  readonly typesMapLocation: string | undefined;
3636
3647
  readonly serverMode: LanguageServiceMode;
3637
3648
  /** Tracks projects that we have already sent telemetry for. */
@@ -9234,7 +9245,7 @@ declare namespace ts {
9234
9245
  * this list is only the set of defaults that are implicitly included.
9235
9246
  */
9236
9247
  function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[];
9237
- function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions): ModuleResolutionCache;
9248
+ function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions, packageJsonInfoCache?: PackageJsonInfoCache): ModuleResolutionCache;
9238
9249
  function createTypeReferenceDirectiveResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions, packageJsonInfoCache?: PackageJsonInfoCache): TypeReferenceDirectiveResolutionCache;
9239
9250
  function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache, mode?: ResolutionMode): ResolvedModuleWithFailedLookupLocations | undefined;
9240
9251
  function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, resolutionMode?: ResolutionMode): ResolvedModuleWithFailedLookupLocations;
@@ -10084,6 +10095,8 @@ declare namespace ts {
10084
10095
  getRenameInfo(fileName: string, position: number, preferences: UserPreferences): RenameInfo;
10085
10096
  /** @deprecated Use the signature with `UserPreferences` instead. */
10086
10097
  getRenameInfo(fileName: string, position: number, options?: RenameInfoOptions): RenameInfo;
10098
+ findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, preferences: UserPreferences): readonly RenameLocation[] | undefined;
10099
+ /** @deprecated Pass `providePrefixAndSuffixTextForRename` as part of a `UserPreferences` parameter. */
10087
10100
  findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename?: boolean): readonly RenameLocation[] | undefined;
10088
10101
  getSmartSelectionRange(fileName: string, position: number): SelectionRange;
10089
10102
  getDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined;
@@ -10129,7 +10142,13 @@ declare namespace ts {
10129
10142
  applyCodeActionCommand(fileName: string, action: CodeActionCommand[]): Promise<ApplyCodeActionCommandResult[]>;
10130
10143
  /** @deprecated `fileName` will be ignored */
10131
10144
  applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise<ApplyCodeActionCommandResult | ApplyCodeActionCommandResult[]>;
10132
- getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason, kind?: string): ApplicableRefactorInfo[];
10145
+ /**
10146
+ * @param includeInteractiveActions Include refactor actions that require additional arguments to be
10147
+ * passed when calling `getEditsForRefactor`. When true, clients should inspect the `isInteractive`
10148
+ * property of each returned `RefactorActionInfo` and ensure they are able to collect the appropriate
10149
+ * arguments for any interactive action before offering it.
10150
+ */
10151
+ getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason, kind?: string, includeInteractiveActions?: boolean): ApplicableRefactorInfo[];
10133
10152
  getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined): RefactorEditInfo | undefined;
10134
10153
  organizeImports(args: OrganizeImportsArgs, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[];
10135
10154
  getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[];
@@ -10401,6 +10420,11 @@ declare namespace ts {
10401
10420
  * The hierarchical dotted name of the refactor action.
10402
10421
  */
10403
10422
  kind?: string;
10423
+ /**
10424
+ * Indicates that the action requires additional arguments to be passed
10425
+ * when calling `getEditsForRefactor`.
10426
+ */
10427
+ isInteractive?: boolean;
10404
10428
  }
10405
10429
  /**
10406
10430
  * A set of edits to make in response to a refactor action, plus an optional