Skip to content

Commit

Permalink
Open scripts right after importing them from vanilla
Browse files Browse the repository at this point in the history
  • Loading branch information
SpontanCombust committed Apr 17, 2024
1 parent 6f72108 commit 250f61e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/user-manual/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ REDKit project support & fixes
- Updated "Project System" with REDKit project information

### Other
- Importing a script file now automatically opens it in the editor
- Opening a new/unknown manifest file now doesn't trigger content graph rebuild and a manual file save action is required to trigger it
- More descriptive errors diagnostics when linking content dependencies
- The extension now also gets published to Eclipse's Open VSX Registry at
Expand Down
2 changes: 2 additions & 0 deletions editors/vscode/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ function commandImportVanillaScripts(): Cmd {
const content0ScriptPath = content0ScriptUri.fsPath;
const relativePath = path.relative(content0ScriptsRootPath, content0ScriptPath);
const projectScriptPath = path.join(projectScriptsRootPath, relativePath);
const projectScriptUri = vscode.Uri.file(projectScriptPath);

let fileAlreadyExists = true;
try {
Expand All @@ -341,6 +342,7 @@ function commandImportVanillaScripts(): Cmd {
// make sure that all the intermediary path components exist
await fs.mkdir(projectScriptDir, { recursive: true });
await fs.copyFile(content0ScriptPath, projectScriptPath);
await vscode.window.showTextDocument(projectScriptUri, { preview: false });
client.info(`Successfully imported ${relativePath} into the project`);
} catch (err) {
client.error(`Failed to import script ${relativePath}: ${err}`);
Expand Down

0 comments on commit 250f61e

Please sign in to comment.