*: cleanup
Making a few changes for publishing the first command
This commit is contained in:
parent
54635910dc
commit
11161b33c5
2 changed files with 11 additions and 17 deletions
22
extension.js
22
extension.js
|
@ -5,21 +5,11 @@ var vscode = require('vscode');
|
||||||
// this method is called when your extension is activated
|
// this method is called when your extension is activated
|
||||||
// your extension is activated the very first time the command is executed
|
// your extension is activated the very first time the command is executed
|
||||||
function activate(context) {
|
function activate(context) {
|
||||||
|
console.log('next-note: activated');
|
||||||
|
|
||||||
// Use the console to output diagnostic information (console.log) and errors (console.error)
|
context.subscriptions.push(vscode.commands.registerCommand('extension.sayHello', function () {
|
||||||
// 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
|
|
||||||
vscode.window.showInformationMessage('Hello World!');
|
vscode.window.showInformationMessage('Hello World!');
|
||||||
});
|
}));
|
||||||
context.subscriptions.push(disposable);
|
|
||||||
|
|
||||||
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;
|
||||||
|
@ -32,16 +22,16 @@ function activate(context) {
|
||||||
if (editor.document.lineCount > cursorEnd.line+1) {
|
if (editor.document.lineCount > cursorEnd.line+1) {
|
||||||
cursorEnd.line += 1;
|
cursorEnd.line += 1;
|
||||||
}
|
}
|
||||||
|
var d = new Date();
|
||||||
editor.edit(editBuilder => {
|
editor.edit(editBuilder => {
|
||||||
editBuilder.insert(cursorEnd, "farts\n");
|
editBuilder.insert(cursorEnd, "## "+ d.toString() +"\n");
|
||||||
});
|
});
|
||||||
console.log(cursorEnd);
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
exports.activate = activate;
|
exports.activate = activate;
|
||||||
|
|
||||||
// this method is called when your extension is deactivated
|
// this method is called when your extension is deactivated
|
||||||
function deactivate() {
|
function deactivate() {
|
||||||
console.log("next-note deactivated")
|
console.log("next-note: deactivated")
|
||||||
}
|
}
|
||||||
exports.deactivate = deactivate;
|
exports.deactivate = deactivate;
|
|
@ -4,6 +4,10 @@
|
||||||
"description": "Helpers for daily notes",
|
"description": "Helpers for daily notes",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"publisher": "vbatts",
|
"publisher": "vbatts",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.thisco.de/vbatts/vscode-next-note"
|
||||||
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.5.0"
|
"vscode": "^1.5.0"
|
||||||
},
|
},
|
||||||
|
@ -24,7 +28,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "extension.nextNoteInsertDate",
|
"command": "extension.nextNoteInsertDate",
|
||||||
"title": "NextDate"
|
"title": "NextNote: Date"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue