Skip to content

Commit

Permalink
style: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
wangtianlun committed Apr 22, 2019
1 parent e5e591e commit 03bb340
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 124 deletions.
34 changes: 17 additions & 17 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

## Keyboard Shortcuts

| Key | Command |
| ------------------------------------------------- | ---------------------------- |
| cmd + m(mac) / ctrl + m(windows) | open a webview of textDocument |
| cmd + s(mac) / ctrl + s(windows) | save mindmap file |
| Key | Command |
| -------------------------------- | ------------------------------ |
| cmd + m(mac) / ctrl + m(windows) | open a webview of textDocument |
| cmd + s(mac) / ctrl + s(windows) | save mindmap file |

## FAQ
- **File parsed incorrectly, the current webview only show initial mindmap**
Expand Down
84 changes: 42 additions & 42 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
{
"name": "vscode-mindmap",
"displayName": "vscode-mindmap",
"icon": "resources/icon.png",
"description": "mindmap for vscode",
"version": "0.0.1",
"publisher": "Souche",
"repository": {
"type": "git",
"url": "https://github.com/souche-rdc/vscode-mindmap.git"
},
"engines": {
"vscode": "^1.33.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onCommand:extension.sayHello"
],
"main": "./out/extension",
"contributes": {
"commands": [
{
"command": "extension.sayHello",
"title": "Hello World"
}
]
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install",
"test": "npm run compile && node ./node_modules/vscode/bin/test"
},
"devDependencies": {
"typescript": "^2.6.1",
"vscode": "^1.1.21",
"tslint": "^5.8.0",
"@types/node": "^8.10.25",
"@types/mocha": "^2.2.42"
}
"name": "vscode-mindmap",
"displayName": "vscode-mindmap",
"icon": "resources/icon.png",
"description": "mindmap for vscode",
"version": "0.0.1",
"publisher": "Souche",
"repository": {
"type": "git",
"url": "https://github.com/souche/vscode-mindmap.git"
},
"engines": {
"vscode": "^1.33.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onCommand:extension.sayHello"
],
"main": "./out/extension",
"contributes": {
"commands": [
{
"command": "extension.sayHello",
"title": "Hello World"
}
]
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install",
"test": "npm run compile && node ./node_modules/vscode/bin/test"
},
"devDependencies": {
"typescript": "^2.6.1",
"vscode": "^1.1.21",
"tslint": "^5.8.0",
"@types/node": "^8.10.25",
"@types/mocha": "^2.2.42"
}
}
27 changes: 5 additions & 22 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
'use strict';
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import * as vscode from 'vscode';

// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
export function activate(context: vscode.ExtensionContext) {
let disposable = vscode.commands.registerCommand('extension.sayHello', () => {
vscode.window.showInformationMessage('Hello World!');
});

// 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 "vscode-mindmap" 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
let disposable = vscode.commands.registerCommand('extension.sayHello', () => {
// 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!');
});

context.subscriptions.push(disposable);
context.subscriptions.push(disposable);
}

// this method is called when your extension is deactivated
export function deactivate() {
}
export function deactivate() {}
6 changes: 3 additions & 3 deletions src/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import * as testRunner from 'vscode/lib/testrunner';
// You can directly control Mocha options by uncommenting the following lines
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
testRunner.configure({
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
useColors: true // colored output from test results
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
useColors: true, // colored output from test results
});

module.exports = testRunner;
module.exports = testRunner;
39 changes: 17 additions & 22 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"lib": [
"es6"
],
"sourceMap": true,
"rootDir": "src",
/* Strict Type-Checking Option */
"strict": true, /* enable all strict type-checking options */
/* Additional Checks */
"noUnusedLocals": true /* Report errors on unused locals. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
},
"exclude": [
"node_modules",
".vscode-test"
]
}
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"lib": ["es6"],
"sourceMap": true,
"rootDir": "src",
/* Strict Type-Checking Option */
"strict": true /* enable all strict type-checking options */,
/* Additional Checks */
"noUnusedLocals": true /* Report errors on unused locals. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
},
"exclude": ["node_modules", ".vscode-test"]
}
25 changes: 11 additions & 14 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
{
"rules": {
"no-string-throw": true,
"no-unused-expression": true,
"no-duplicate-variable": true,
"curly": true,
"class-name": true,
"semicolon": [
true,
"always"
],
"triple-equals": true
},
"defaultSeverity": "warning"
}
"rules": {
"no-string-throw": true,
"no-unused-expression": true,
"no-duplicate-variable": true,
"curly": true,
"class-name": true,
"semicolon": [true, "always"],
"triple-equals": true
},
"defaultSeverity": "warning"
}

0 comments on commit 03bb340

Please sign in to comment.