Skip to content

Commit

Permalink
chore(all): initial vscode plugin setup
Browse files Browse the repository at this point in the history
  • Loading branch information
erik-lieben committed Sep 25, 2016
1 parent 35f0d3a commit 82e9604
Show file tree
Hide file tree
Showing 14 changed files with 173 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
node_modules
jspm_packages
bower_components
.idea
.DS_STORE
*.swp
Expand Down
28 changes: 28 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// A launch configuration that compiles the extension and then opens it inside a new window
{
"version": "0.1.0",
"configurations": [
{
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
"stopOnEntry": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}/dist/src",
"preLaunchTask": "npm"
},
{
"name": "Launch Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/dist/test" ],
"stopOnEntry": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}/dist/test",
"preLaunchTask": "npm"
}
]
}
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"dist": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"dist": true // set this to false to include "out" folder in search results
},
"typescript.tsdk": "./node_modules/typescript/lib" // we want to use the TS server from our node_modules folder to control its version
}
30 changes: 30 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process

// A task runner that calls a custom npm script that compiles the extension.
{
"version": "0.1.0",

// we want to run npm
"command": "npm",

// the command is a shell script
"isShellCommand": true,

// show the output window only if unrecognized errors occur.
"showOutput": "silent",

// we run the custom script "compile" as defined in package.json
"args": ["run", "compile", "--loglevel", "silent"],

// The tsc compiler is started in watching mode
"isWatching": true,

// use the standard tsc in watch mode problem matcher to find compile problems in the output.
"problemMatcher": "$tsc-watch"
}
9 changes: 9 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.vscode/**
typings/**
out/test/**
test/**
src/**
**/*.map
.gitignore
tsconfig.json
vsc-extension-quickstart.md
10 changes: 10 additions & 0 deletions dist/src/extension.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/src/extension.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,34 @@
},
"license": "MIT",
"author": "",
"publisher": "Aurelia",
"repository": {
"type": "git",
"url": "https://github.com/aurelia/vscode-extension"
},
"engines": {
"vscode": "^1.4.0"
},
"categories": [
"Other"
],
"activationEvents": [],
"main": "./dist/src/extension",
"contributes": {},
"scripts": {
"vscode:prepublish": "node ./node_modules/vscode/bin/compile",
"compile": "node ./node_modules/vscode/bin/compile -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install",
"lint": "node ./node_modules/tslint/lib/tslint-cli.js -c tslint.json --project tsconfig.json",
"changelog": "node ./node_modules/conventional-changelog-cli/cli.js -p angular -i doc/CHANGELOG.md -s"
},
"devDependencies": {
"@types/chai": "^3.4.33",
"conventional-changelog-cli": "^1.2.0",
"tslint": "^3.15.1",
"typescript": "^2.0.3",
"vscode": "^0.11.18"
},
"dependencies": {
}
}
10 changes: 10 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ExtensionContext, OutputChannel, window } from 'vscode';

let outputChannel: OutputChannel;

export function activate(context: ExtensionContext) {

// Create default output channel
outputChannel = window.createOutputChannel('aurelia');
context.subscriptions.push(outputChannel);
}
10 changes: 10 additions & 0 deletions test/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import testRunner = require('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
});

module.exports = testRunner;
20 changes: 20 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2015",
"outDir": "dist",
"sourceMap": true,
"rootDir": ".",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"moduleResolution" : "node",
"lib": ["es2015"],
"types" : [
"chai"
]
},
"exclude": [
"node_modules",
".vscode-test"
]
}
8 changes: 8 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "tslint:recommended",
"rules": {
"quotemark": [true, "single", "avoid-escape"]
},
"rulesDirectory": [
]
}
1 change: 1 addition & 0 deletions typings/node.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference path="../node_modules/vscode/typings/node.d.ts" />
10 changes: 10 additions & 0 deletions typings/vscode-typings.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/// <reference path="../node_modules/vscode/typings/index.d.ts" />


declare namespace TestRunner {
export function configure(mochaSettings: any): void;
}

declare module 'vscode/lib/testrunner' {
export = TestRunner;
}

0 comments on commit 82e9604

Please sign in to comment.