Skip to content

Can open the problem file directly #511

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 1 commit into from
Feb 14, 2020
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: 5 additions & 1 deletion src/utils/workspaceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@ export async function selectWorkspaceFolder(): Promise<string> {
if (needAsk) {
const choice: string | undefined = await vscode.window.showQuickPick(
[
OpenOption.justOpenFile,
OpenOption.openInCurrentWindow,
OpenOption.openInNewWindow,
OpenOption.addToWorkspace,
],
{ placeHolder: "Select how you would like to open your workspace folder" },
{ placeHolder: "The LeetCode workspace folder is not opened in VS Code, would you like to open it?" },
);

switch (choice) {
case OpenOption.justOpenFile:
return workspaceFolderSetting;
case OpenOption.openInCurrentWindow:
await vscode.commands.executeCommand("vscode.openFolder", vscode.Uri.file(workspaceFolderSetting), false);
return "";
Expand Down Expand Up @@ -117,6 +120,7 @@ async function determineLeetCodeFolder(): Promise<string> {
}

enum OpenOption {
justOpenFile = "Just open the problem file",
openInCurrentWindow = "Open in current window",
openInNewWindow = "Open in new window",
addToWorkspace = "Add to workspace",
Expand Down