From 622519cc64d49eb4e6066aee806c3e0bcfc9812e Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 22 Feb 2017 13:31:45 -0500 Subject: [PATCH] *: readying to replace find-todos --- extension.js | 13 +++++++++++++ package.json | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/extension.js b/extension.js index 6336e7c..0cf85b3 100644 --- a/extension.js +++ b/extension.js @@ -9,6 +9,19 @@ var dateFormat = require('dateformat'); function activate(context) { console.log('next-note: activated'); + context.subscriptions.push(vscode.commands.registerTextEditorCommand('extension.nextNoteFindTodos', function () { + // this may not require being an open TetEditor, + // because it'd be nice to open it in a new buffer + // that has hyperlinks to each TODO line. + var editor = vscode.window.activeTextEditor; + var notePaths = []; + + fs.readdir(getBasedir(), {encoding: "utf8"}, (err, files) => { + console.log(files); + // TODO match on "Task*.md" and map to TODO lines + }); + })); + context.subscriptions.push(vscode.commands.registerTextEditorCommand('extension.nextNoteInsertDate', function () { var editor = vscode.window.activeTextEditor; if (!editor) { diff --git a/package.json b/package.json index 00da06b..3a09959 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ ], "activationEvents": [ "onCommand:extension.nextNoteInsertDate", + "onCommand:extension.nextNoteFindTodos", "onCommand:extension.nextNoteOpenCurrentWeek", "onCommand:extension.nextNoteOpenPreviousWeek", "onCommand:extension.nextNoteOpenNextWeek" @@ -23,6 +24,10 @@ "main": "./extension", "contributes": { "commands": [ + { + "command": "extension.nextNoteFindTodos", + "title": "NextNote: Find TODOs in notes" + }, { "command": "extension.nextNoteOpenPreviousWeek", "title": "NextNote: Open Previous Week" @@ -50,6 +55,7 @@ }, "devDependencies": { "typescript": "^2.0.3", + "dateformat": "^2.0.0", "vscode": "^1.0.0", "mocha": "^2.3.3", "eslint": "^3.6.0",