Skip to content

Commit

Permalink
LImit opening documents to certain scenarios. (#3308)
Browse files Browse the repository at this point in the history
  • Loading branch information
philliphoff authored Sep 2, 2022
1 parent fe9f047 commit b843961
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,18 @@ export class PysteinProjectCreateStep extends ScriptProjectCreateStep {

const functionAppPath = Uri.file(path.join(context.projectPath, pythonFunctionAppFileName));

if (await fileExists(functionAppPath)) {
await window.showTextDocument(await workspace.openTextDocument(functionAppPath));
}
// Only open the documents if they're part of the existing/new workspace.
// NOTE: We don't currently have a way to open specific documents in the new (or reloaded) window.
if (context.openBehavior === 'AddToWorkspace' || context.openBehavior === 'AlreadyOpen') {
if (await fileExists(functionAppPath)) {
await window.showTextDocument(await workspace.openTextDocument(functionAppPath));
}

const gettingStartedPath = Uri.file(path.join(context.projectPath, gettingStartedFileName));
const gettingStartedPath = Uri.file(path.join(context.projectPath, gettingStartedFileName));

if (await fileExists(gettingStartedPath)) {
await showMarkdownPreviewFile(gettingStartedPath, /* openToSide: */ true);
if (await fileExists(gettingStartedPath)) {
await showMarkdownPreviewFile(gettingStartedPath, /* openToSide: */ true);
}
}
}

Expand Down

0 comments on commit b843961

Please sign in to comment.