mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Added skipDestructiveCodeActions argument to organize imports server command (#43184)
* Stopped removing unused imports in files with syntactic errors * Added allowDestructiveCodeActions arg * Updated .d.ts baselines * Stop factoring syntax errors. Weird that no tests break... * Have args extend scope so it is not a breaking change * Update src/harness/harnessLanguageService.ts Co-authored-by: Jesse Trinity <jetrinit@microsoft.com> * Fixed API breaking change, and renamed to skip * Always with the baselines * One more .d.ts baseline to fix * Remove blank line in src/harness/harnessLanguageService.ts Co-authored-by: Jesse Trinity <jetrinit@microsoft.com>
This commit is contained in:
@@ -2017,13 +2017,13 @@ namespace ts {
|
||||
return codefix.getAllFixes({ fixId, sourceFile, program, host, cancellationToken, formatContext, preferences });
|
||||
}
|
||||
|
||||
function organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings, preferences: UserPreferences = emptyOptions): readonly FileTextChanges[] {
|
||||
function organizeImports(args: OrganizeImportsArgs, formatOptions: FormatCodeSettings, preferences: UserPreferences = emptyOptions): readonly FileTextChanges[] {
|
||||
synchronizeHostData();
|
||||
Debug.assert(scope.type === "file");
|
||||
const sourceFile = getValidSourceFile(scope.fileName);
|
||||
Debug.assert(args.type === "file");
|
||||
const sourceFile = getValidSourceFile(args.fileName);
|
||||
const formatContext = formatting.getFormatContext(formatOptions, host);
|
||||
|
||||
return OrganizeImports.organizeImports(sourceFile, formatContext, host, program, preferences);
|
||||
return OrganizeImports.organizeImports(sourceFile, formatContext, host, program, preferences, args.skipDestructiveCodeActions);
|
||||
}
|
||||
|
||||
function getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences = emptyOptions): readonly FileTextChanges[] {
|
||||
|
||||
Reference in New Issue
Block a user