*: readying to replace find-todos

This commit is contained in:
Vincent Batts 2017-02-22 13:31:45 -05:00
parent 8c51dfaca1
commit 622519cc64
2 changed files with 19 additions and 0 deletions

View File

@ -9,6 +9,19 @@ var dateFormat = require('dateformat');
function activate(context) { function activate(context) {
console.log('next-note: activated'); 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 () { context.subscriptions.push(vscode.commands.registerTextEditorCommand('extension.nextNoteInsertDate', function () {
var editor = vscode.window.activeTextEditor; var editor = vscode.window.activeTextEditor;
if (!editor) { if (!editor) {

View File

@ -16,6 +16,7 @@
], ],
"activationEvents": [ "activationEvents": [
"onCommand:extension.nextNoteInsertDate", "onCommand:extension.nextNoteInsertDate",
"onCommand:extension.nextNoteFindTodos",
"onCommand:extension.nextNoteOpenCurrentWeek", "onCommand:extension.nextNoteOpenCurrentWeek",
"onCommand:extension.nextNoteOpenPreviousWeek", "onCommand:extension.nextNoteOpenPreviousWeek",
"onCommand:extension.nextNoteOpenNextWeek" "onCommand:extension.nextNoteOpenNextWeek"
@ -23,6 +24,10 @@
"main": "./extension", "main": "./extension",
"contributes": { "contributes": {
"commands": [ "commands": [
{
"command": "extension.nextNoteFindTodos",
"title": "NextNote: Find TODOs in notes"
},
{ {
"command": "extension.nextNoteOpenPreviousWeek", "command": "extension.nextNoteOpenPreviousWeek",
"title": "NextNote: Open Previous Week" "title": "NextNote: Open Previous Week"
@ -50,6 +55,7 @@
}, },
"devDependencies": { "devDependencies": {
"typescript": "^2.0.3", "typescript": "^2.0.3",
"dateformat": "^2.0.0",
"vscode": "^1.0.0", "vscode": "^1.0.0",
"mocha": "^2.3.3", "mocha": "^2.3.3",
"eslint": "^3.6.0", "eslint": "^3.6.0",