Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarlevin committed Dec 30, 2024
1 parent 635045f commit 052b3a3
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { cli } from "./cli";

export {
getProjectFolder,
getDir,
installPretext,
setSchema,
setSpellCheckConfig,
Expand Down Expand Up @@ -36,38 +35,6 @@ function getProjectFolder(dirPath: string): string | null {
}
}

function getDir(myPath: string = "") {
if (myPath !== "") {
console.log("Dir ", myPath, " passed as argument");
return myPath;
}
if (vscode.workspace.workspaceFolders !== undefined) {
myPath = vscode.workspace.workspaceFolders[0].uri.fsPath;
console.log("Dir ", myPath, " set by workspace folder");
return myPath;
} else if (vscode.window.activeTextEditor !== undefined) {
myPath = path.dirname(vscode.window.activeTextEditor.document.uri.fsPath);
console.log("Dir ", myPath, " set by active text editor");
return myPath;
} else {
console.log("No active editor or workspace folder.");
vscode.window
.showOpenDialog({
openLabel: "Select root folder of your project...",
canSelectMany: false,
canSelectFiles: false,
canSelectFolders: true,
})
.then((fileUri) => {
if (fileUri && fileUri[0]) {
console.log("Selected file: " + fileUri[0].fsPath);
return fileUri[0].fsPath;
}
});
return "";
}
}

async function installPretext(progress: vscode.Progress<{}>) {
// Here we will attempt to pip install pretext, upgraded to the most recent version. This will happen if pretext is not found, or if a user requests it through a command.

Expand Down

0 comments on commit 052b3a3

Please sign in to comment.