-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code cleanup and renamed extension activation command to topper.addTo…
…pHeader.
- Loading branch information
1 parent
3c2f3cf
commit 225a845
Showing
6 changed files
with
246 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
// Place your settings in this file to overwrite default and user settings. | ||
{ | ||
"cSpell.words": [ | ||
"loginfo" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,30 @@ | ||
// The module 'vscode' contains the VS Code extensibility API | ||
// Import the module and reference it with the alias vscode in your code below | ||
var vscode = require('vscode'); | ||
var vscode = require("vscode"); | ||
|
||
// topper specific import | ||
const Topper = require("./topper.js"); | ||
|
||
// this method is called when your extension is activated | ||
// your extension is activated the very first time the command is executed | ||
/** | ||
* Invoked when the extension is activated. | ||
* @param {any} context | ||
*/ | ||
function activate(context) { | ||
|
||
// 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 "topper" 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 addTopHeader = vscode.commands.registerCommand('extension.addTopHeader', function () { | ||
|
||
// the code below is executed every time the command `topper.addTopHeader` is executed | ||
console.log("Topper is going to add header to the active file!"); | ||
|
||
Topper.topper.addTopHeader(); | ||
|
||
console.log("Your header has been successfully added to the file!"); | ||
}); | ||
|
||
context.subscriptions.push(addTopHeader); | ||
console.log('Congratulations, your extension "topper" is now active!'); | ||
var addTopHeader = vscode.commands.registerCommand("topper.addTopHeader", function() { | ||
console.log("Topper is going to add header to the active file!"); | ||
Topper.topper.addTopHeader(); | ||
console.log("Your header has been successfully added to the file!"); | ||
}); | ||
context.subscriptions.push(addTopHeader); | ||
} | ||
|
||
// this method is called when your extension is deactivated | ||
function deactivate() { } | ||
/** | ||
* Invoked when the extension is deactivated. | ||
*/ | ||
function deactivate() { | ||
console.log("Topper has been deactivated."); | ||
} | ||
|
||
exports.activate = activate; | ||
exports.deactivate = deactivate; | ||
exports.deactivate = deactivate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,119 +1,111 @@ | ||
{ | ||
"name": "topper", | ||
"displayName": "topper", | ||
"description": "A fileheader utility", | ||
"version": "0.0.2", | ||
"publisher": "sidmishraw", | ||
"engines": { | ||
"vscode": "^1.13.0" | ||
}, | ||
"categories": [ | ||
"Snippets", | ||
"Other" | ||
"name": "topper", | ||
"displayName": "topper", | ||
"description": "A fileheader utility", | ||
"version": "0.0.2", | ||
"publisher": "sidmishraw", | ||
"engines": { | ||
"vscode": "^1.13.0" | ||
}, | ||
"categories": ["Snippets", "Other"], | ||
"activationEvents": ["onCommand:topper.addTopHeader"], | ||
"main": "./extension", | ||
"contributes": { | ||
"commands": [ | ||
{ | ||
"command": "topper.addTopHeader", | ||
"title": "Topper: Add header" | ||
} | ||
], | ||
"activationEvents": [ | ||
"onCommand:extension.addTopHeader" | ||
], | ||
"main": "./extension", | ||
"contributes": { | ||
"commands": [ | ||
"configuration": { | ||
"type": "object", | ||
"title": "Topper configuration", | ||
"properties": { | ||
"topper.customTemplateParameters": { | ||
"type": "array", | ||
"description": | ||
"Configures template parameters. These parameters can be used in the header templates as placeholders.", | ||
"default": [ | ||
{ | ||
"personalProfile": { | ||
"author": "bulbasaur", | ||
"website": "bulbasaur.github.bitbucket.yababbdadado.com", | ||
"copyright": "None \n None", | ||
"license": "None", | ||
"email": "ivysaur.bulbasaur@venosaur.com" | ||
} | ||
}, | ||
{ | ||
"command": "extension.addTopHeader", | ||
"title": "Topper: Add header" | ||
"officeProfile": { | ||
"author": "John Doe", | ||
"department": "Product Development", | ||
"email": "john.doe@doejohn.com" | ||
} | ||
} | ||
], | ||
"configuration": { | ||
"type": "object", | ||
"title": "Topper configuration", | ||
"properties": { | ||
"topper.customTemplateParameters": { | ||
"type": "array", | ||
"description": "Configures template parameters. These parameters can be used in the header templates as placeholders.", | ||
"default": [ | ||
{ | ||
"personalProfile": { | ||
"author": "bulbasaur", | ||
"website": "bulbasaur.github.bitbucket.yababbdadado.com", | ||
"copyright": "None \n None", | ||
"license": "None", | ||
"email": "ivysaur.bulbasaur@venosaur.com" | ||
} | ||
}, | ||
{ | ||
"officeProfile": { | ||
"author": "John Doe", | ||
"department": "Product Development", | ||
"email": "john.doe@doejohn.com" | ||
} | ||
} | ||
] | ||
}, | ||
"topper.headerTemplates": { | ||
"type": "array", | ||
"description": "Configure the templates for the headers depending on the languageId inferred by the editor. The list of language Ids can be found here: https://code.visualstudio.com/docs/languages/identifiers. \nIf the file's languageId is not configured here, it defaults to the `defaultCStyled` header template. \nPlease do not delete this template. Copy it over when configuring this section. \nNote: Please keep the `defaultCStyled` as the first element in the list of all the header templates. \nFor more information, refer to the Readme.md.", | ||
"default": [ | ||
{ | ||
"defaultCStyled": { | ||
"headerBegin": "/**", | ||
"headerPrefix": "*", | ||
"headerEnd": "*/", | ||
"template": [ | ||
"${headerBegin}", | ||
"${headerPrefix} ${fileName}", | ||
"${headerPrefix} @author ${author}", | ||
"${headerPrefix} @description ${description}", | ||
"${headerPrefix} @created ${createdDate}", | ||
"${headerPrefix} @copyright ${copyright}", | ||
"${headerPrefix} @last-modified ${lastModifiedDate}", | ||
"${headerEnd}" | ||
] | ||
} | ||
}, | ||
{ | ||
"python": { | ||
"headerBegin": "#", | ||
"headerPrefix": "#", | ||
"headerEnd": "#", | ||
"template": [ | ||
"${headerBegin}", | ||
"${headerPrefix} ${fileName}", | ||
"${headerPrefix} @author ${author}", | ||
"${headerPrefix} @description ${description}", | ||
"${headerPrefix} @created ${createdDate}", | ||
"${headerPrefix} @last-modified ${lastModifiedDate}", | ||
"${headerEnd}" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"topper.headerTemplates": { | ||
"type": "array", | ||
"description": | ||
"Configure the templates for the headers depending on the languageId inferred by the editor. The list of language Ids can be found here: https://code.visualstudio.com/docs/languages/identifiers. \nIf the file's languageId is not configured here, it defaults to the `defaultCStyled` header template. \nPlease do not delete this template. Copy it over when configuring this section. \nNote: Please keep the `defaultCStyled` as the first element in the list of all the header templates. \nFor more information, refer to the Readme.md.", | ||
"default": [ | ||
{ | ||
"defaultCStyled": { | ||
"headerBegin": "/**", | ||
"headerPrefix": "*", | ||
"headerEnd": "*/", | ||
"template": [ | ||
"${headerBegin}", | ||
"${headerPrefix} ${fileName}", | ||
"${headerPrefix} @author ${author}", | ||
"${headerPrefix} @description ${description}", | ||
"${headerPrefix} @created ${createdDate}", | ||
"${headerPrefix} @copyright ${copyright}", | ||
"${headerPrefix} @last-modified ${lastModifiedDate}", | ||
"${headerEnd}" | ||
] | ||
} | ||
}, | ||
{ | ||
"python": { | ||
"headerBegin": "#", | ||
"headerPrefix": "#", | ||
"headerEnd": "#", | ||
"template": [ | ||
"${headerBegin}", | ||
"${headerPrefix} ${fileName}", | ||
"${headerPrefix} @author ${author}", | ||
"${headerPrefix} @description ${description}", | ||
"${headerPrefix} @created ${createdDate}", | ||
"${headerPrefix} @last-modified ${lastModifiedDate}", | ||
"${headerEnd}" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"scripts": { | ||
"postinstall": "node ./node_modules/vscode/bin/install", | ||
"test": "node ./node_modules/vscode/bin/test" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^2.0.3", | ||
"vscode": "^1.0.0", | ||
"mocha": "^2.3.3", | ||
"eslint": "^3.6.0", | ||
"@types/node": "^6.0.40", | ||
"@types/mocha": "^2.2.32" | ||
}, | ||
"keywords": [ | ||
"file header", | ||
"fileheader", | ||
"template", | ||
"code template" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/sidmishraw/topper.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/sidmishraw/topper/issues", | ||
"email": "sidmishraw@hotmail.com" | ||
} | ||
} | ||
} | ||
}, | ||
"scripts": { | ||
"postinstall": "node ./node_modules/vscode/bin/install", | ||
"test": "node ./node_modules/vscode/bin/test" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^2.0.3", | ||
"vscode": "^1.0.0", | ||
"mocha": "^2.3.3", | ||
"eslint": "^3.6.0", | ||
"@types/node": "^6.0.40", | ||
"@types/mocha": "^2.2.32" | ||
}, | ||
"keywords": ["file header", "fileheader", "template", "code template"], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/sidmishraw/topper.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/sidmishraw/topper/issues", | ||
"email": "sidmishraw@hotmail.com" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.