From 11161b33c51ad946bfc38aa170a1ec7d221960fb Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Mon, 20 Feb 2017 10:39:04 -0500 Subject: [PATCH] *: cleanup Making a few changes for publishing the first command --- extension.js | 22 ++++++---------------- package.json | 6 +++++- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/extension.js b/extension.js index b95eacf..eca878c 100644 --- a/extension.js +++ b/extension.js @@ -5,21 +5,11 @@ var vscode = require('vscode'); // this method is called when your extension is activated // your extension is activated the very first time the command is executed function activate(context) { + console.log('next-note: activated'); - // Use the console to output diagnostic information (console.log) and errors (console.error) - // This line of code will only be executed once when your extension is activated - console.log('Congratulations, your extension "next-note" is now active!'); - - // The command has been defined in the package.json file - // Now provide the implementation of the command with registerCommand - // The commandId parameter must match the command field in package.json - var disposable = vscode.commands.registerCommand('extension.sayHello', function () { - // The code you place here will be executed every time your command is executed - - // Display a message box to the user + context.subscriptions.push(vscode.commands.registerCommand('extension.sayHello', function () { vscode.window.showInformationMessage('Hello World!'); - }); - context.subscriptions.push(disposable); + })); context.subscriptions.push(vscode.commands.registerTextEditorCommand('extension.nextNoteInsertDate', function () { var editor = vscode.window.activeTextEditor; @@ -32,16 +22,16 @@ function activate(context) { if (editor.document.lineCount > cursorEnd.line+1) { cursorEnd.line += 1; } + var d = new Date(); editor.edit(editBuilder => { - editBuilder.insert(cursorEnd, "farts\n"); + editBuilder.insert(cursorEnd, "## "+ d.toString() +"\n"); }); - console.log(cursorEnd); })); } exports.activate = activate; // this method is called when your extension is deactivated function deactivate() { - console.log("next-note deactivated") + console.log("next-note: deactivated") } exports.deactivate = deactivate; \ No newline at end of file diff --git a/package.json b/package.json index 89ba043..9d614b4 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,10 @@ "description": "Helpers for daily notes", "version": "0.0.1", "publisher": "vbatts", + "repository": { + "type": "git", + "url": "https://git.thisco.de/vbatts/vscode-next-note" + }, "engines": { "vscode": "^1.5.0" }, @@ -24,7 +28,7 @@ }, { "command": "extension.nextNoteInsertDate", - "title": "NextDate" + "title": "NextNote: Date" } ] },