update to 0.4

This commit is contained in:
2017-03-09 15:10:13 +08:00
parent bce6338bb1
commit 5e24827152
4 changed files with 65 additions and 110 deletions
+2 -1
View File
@@ -1 +1,2 @@
node_modules
node_modules
npm-debug.*
+5 -54
View File
@@ -1,65 +1,16 @@
# recent-files README
This is the README for your extension "recent-files". After writing up a brief description, we recommend including the following sections.
## Features
Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
For example if there is an image subfolder under your extension project workspace:
\!\[feature X\]\(images/feature-x.png\)
> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
## Requirements
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
## Extension Settings
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
For example:
This extension contributes the following settings:
* `myExtension.enable`: enable/disable this extension
* `myExtension.thing`: set to `blah` to do something
This plugin is just like when you do `cmd` or `ctrl` + `E` in Intellij idea, to help you to see the recently opened files in a list.
## Known Issues
Calling out known issues can help limit users opening duplicate issues against your extension.
***
## Release Notes
Users appreciate release notes as you update your extension.
### 0.3.0
### 1.0.0
Allow you to see recently opened files and choose one of them of open it.
Initial release of ...
### 1.0.1
Fixed issue #.
### 1.1.0
Added features X, Y, and Z.
-----------------------------------------------------------------------------------------------------------
## Working with Markdown
**Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
* Split the editor (`Cmd+\` on OSX or `Ctrl+\` on Windows and Linux)
* Toggle preview (`Shift+CMD+V` on OSX or `Shift+Ctrl+V` on Windows and Linux)
* Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (OSX) to see a list of Markdown snippets
### For more information
* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
**Enjoy!**
-------------------------------------------------------------------------------------
+19 -16
View File
@@ -11,7 +11,7 @@ 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 "recent-files" is now active!');
console.log('"recent-files" is now active!');
// The command has been defined in the package.json file
// Now provide the implementation of the command with registerCommand
@@ -19,21 +19,8 @@ function activate(context) {
var disposable = vscode.commands.registerCommand('extension.openRecentlyFiles', 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.showQuickPick(map.keys()).then((item) => {
if(!item || item.trim === "") {
return
}
let uri = map.get(item);
if(uri === null) {
vscode.window.showWarningMessage("Can't find the file you choosed.")
return;
}
let targetDocument = vscode.workspace.openTextDocument(map.get(item));
targetDocument.then(function (document) {
vscode.window.showTextDocument(document);
});
handleUserInput(item);
});
});
@@ -52,5 +39,21 @@ exports.activate = activate;
// this method is called when your extension is deactivated
function deactivate() {
map.clear();
}
exports.deactivate = deactivate;
exports.deactivate = deactivate;
function handleUserInput(item) {
if (!item || item.trim === "") {
return
}
let uri = map.get(item);
if (uri === null) {
vscode.window.showWarningMessage("Can't find the file you choosed.")
return;
}
let targetDocument = vscode.workspace.openTextDocument(map.get(item));
targetDocument.then(function (document) {
vscode.window.showTextDocument(document);
});
}
+39 -39
View File
@@ -1,47 +1,47 @@
{
"name": "recent-files",
"displayName": "Recent files",
"description": "Open recent files like Intellij idea.",
"version": "0.2.0",
"publisher": "junv",
"engines": {
"vscode": "^1.10.0"
},
"categories": [
"Other"
],
"activationEvents": [
"*"
],
"main": "./extension",
"contributes": {
"commands": [
{
"command": "extension.openRecentlyFiles",
"title": "Recently Files"
}
"name": "recent-files",
"displayName": "Recent files",
"description": "Open recent files like you do in Intellij idea.",
"version": "0.4.0",
"publisher": "junv",
"engines": {
"vscode": "^1.10.0"
},
"categories": [
"Other"
],
"keybindings": [
"activationEvents": [
"*"
],
"main": "./extension",
"contributes": {
"commands": [
{
"command": "extension.openRecentlyFiles",
"title": "Recently Files"
}
],
"keybindings": [
{
"command": "extension.openRecentlyFiles",
"key": "ctrl+e",
"mac": "cmd+e"
}
]
},
"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"
},
"dependencies": {
"linked-map": "^2.2.2"
}
}
},
"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"
},
"dependencies": {
"linked-map": "^2.2.2"
}
}