Skip to content
Open
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
11 changes: 10 additions & 1 deletion src/utils/settingUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import { workspace, WorkspaceConfiguration } from "vscode";
import { DescriptionConfiguration } from "../shared";
import * as fse from 'fs-extra';

export function getWorkspaceConfiguration(): WorkspaceConfiguration {
return workspace.getConfiguration("leetcode");
Expand All @@ -13,7 +14,15 @@ export function shouldHideSolvedProblem(): boolean {
}

export function getWorkspaceFolder(): string {
return getWorkspaceConfiguration().get<string>("workspaceFolder", "");
const workspaceFolder = getWorkspaceConfiguration().get<string>('workspaceFolder', '');
const workspaceFolderList = workspaceFolder.split(',');
for (let i = 0; i < workspaceFolderList.length; i++) {
const path = workspaceFolderList[i];
if (fse.pathExistsSync(path)) {
return path;
}
}
return workspaceFolder;
}

export function getEditorShortcuts(): string[] {
Expand Down