diff --git a/CHANGELOG.md b/CHANGELOG.md index b93a2672..f361d70d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -## [2.1.0] - 2020-08-XX - Upcoming release +## [2.1.0] - 2020-08-04 - [#44](https://github.com/estruyf/vscode-front-matter/issues/45): Added article creation command - [#45](https://github.com/estruyf/vscode-front-matter/issues/45): WSL support added diff --git a/src/commands/Folders.ts b/src/commands/Folders.ts index 1f553c0a..46f409c8 100644 --- a/src/commands/Folders.ts +++ b/src/commands/Folders.ts @@ -7,6 +7,10 @@ import { Template } from "./Template"; export class Folders { + /** + * Create content in a registered folder + * @returns + */ public static async create() { const folders = Folders.get(); @@ -38,12 +42,12 @@ export class Folders { * @param folder */ public static async register(folder: Uri) { - if (folder && folder.path) { - const wslPath = folder.path.replace(/\//g, '\\'); + if (folder && folder.fsPath) { + const wslPath = folder.fsPath.replace(/\//g, '\\'); let folders = Folders.get(); - const exists = folders.find(f => f.paths.includes(folder.path) || f.paths.includes(wslPath)); + const exists = folders.find(f => f.paths.includes(folder.fsPath) || f.paths.includes(wslPath)); if (exists) { return window.showInformationMessage(`Folder is already registered`); @@ -58,10 +62,7 @@ export class Folders { folders.push({ title: folderName, fsPath: folder.fsPath, - paths: [ - folder.path, - wslPath - ] + paths: folder.fsPath === wslPath ? [folder.fsPath] : [folder.fsPath, wslPath] } as ContentFolder); folders = uniqBy(folders, f => f.fsPath); diff --git a/src/extension.ts b/src/extension.ts index 70be28e9..eea5485c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -80,18 +80,6 @@ export async function activate({ subscriptions, extensionUri }: vscode.Extension const createContent = vscode.commands.registerCommand(`frontMatter.createContent`, Folders.create); - try { - const allPaths = await vscode.commands.executeCommand("_workbench.getRecentlyOpened"); - - console.log(vscode.window.activeTextEditor?.document.uri) - console.log(vscode.Uri.parse(`vscode-remote:///home`)) - - console.log(`remoteName`, vscode.env.remoteName); - console.log(`appRoot`, vscode.env.appRoot); - } catch (e) { - console.log(e?.message || e) - } - Folders.updateVsCodeCtx(); // Create the status bar