Skip to content

Fix Import Local Files... command #1396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/commands/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ export async function importLocalFilesToServerSideFolder(wsFolderUri: vscode.Uri
return;
}
// Get the name and content of the files to import
const textDecoder = new TextDecoder();
const docs = await Promise.allSettled<{ name: string; content: string; uri: vscode.Uri }>(
uris.map((uri) =>
vscode.workspace.fs
Expand Down Expand Up @@ -768,11 +769,12 @@ export async function importLocalFilesToServerSideFolder(wsFolderUri: vscode.Uri
docs.map((e) => e.name)
);
// Import the files
const textDecoder = new TextDecoder();
return Promise.allSettled<string>(
docs.map(
throttleRequests((doc: { name: string; content: string; uri: vscode.Uri }) => {
return importFileFromContent(doc.name, doc.content, api).then(() => {
// Allow importing over deployed classes since the XML import
// command and SMP, terminal, and Studio imports allow it
return importFileFromContent(doc.name, doc.content, api, false, true).then(() => {
outputChannel.appendLine("Imported file: " + doc.uri.path.split("/").pop());
return doc.name;
});
Expand Down