Skip to content

Commit 2d99511

Browse files
authored
Support "Add all missing imports" (#2753)
Signed-off-by: Shi Chen <[email protected]>
1 parent 721df96 commit 2d99511

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sourceAction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function registerOrganizeImportsCommand(languageClient: LanguageClient, context:
119119
}
120120

121121
function registerChooseImportCommand(context: ExtensionContext): void {
122-
context.subscriptions.push(commands.registerCommand(Commands.CHOOSE_IMPORTS, async (uri: string, selections: ImportSelection[]) => {
122+
context.subscriptions.push(commands.registerCommand(Commands.CHOOSE_IMPORTS, async (uri: string, selections: ImportSelection[], restoreExistingImports?: boolean) => {
123123
const chosen: ImportCandidate[] = [];
124124
const fileUri: Uri = Uri.parse(uri);
125125
for (let i = 0; i < selections.length; i++) {
@@ -140,7 +140,7 @@ function registerChooseImportCommand(context: ExtensionContext): void {
140140
try {
141141
const pick = await new Promise<any>((resolve, reject) => {
142142
const input = window.createQuickPick();
143-
input.title = "Organize Imports";
143+
input.title = restoreExistingImports ? "Add All Missing Imports" : "Organize Imports";
144144
input.step = i + 1;
145145
input.totalSteps = selections.length;
146146
input.placeholder = `Choose type '${typeName}' to import`;

0 commit comments

Comments
 (0)