Skip to content

Commit 82f8223

Browse files
committed
ecosystem-vscode-plugin github repo setup - first commit
Signed-off-by: Gaurav Gupta <[email protected]>
0 parents  commit 82f8223

17 files changed

+291
-0
lines changed

Diff for: .gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/nbproject/private/
2+
out
3+
node_modules
4+
yarn.lock

Diff for: .vscode/extensions.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
"ms-vscode.vscode-typescript-tslint-plugin"
6+
]
7+
}

Diff for: .vscode/launch.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// A launch configuration that compiles the extension and then opens it inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Run Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"runtimeExecutable": "${execPath}",
13+
"args": [
14+
"--extensionDevelopmentPath=${workspaceFolder}"
15+
],
16+
"outFiles": [
17+
"${workspaceFolder}/out/**/*.js"
18+
],
19+
"preLaunchTask": "${defaultBuildTask}"
20+
},
21+
{
22+
"name": "Extension Tests",
23+
"type": "extensionHost",
24+
"request": "launch",
25+
"runtimeExecutable": "${execPath}",
26+
"args": [
27+
"--extensionDevelopmentPath=${workspaceFolder}",
28+
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
29+
],
30+
"outFiles": [
31+
"${workspaceFolder}/out/test/**/*.js"
32+
],
33+
"preLaunchTask": "${defaultBuildTask}"
34+
}
35+
]
36+
}

Diff for: .vscode/settings.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
"files.exclude": {
4+
"out": false // set this to true to hide the "out" folder with the compiled JS files
5+
},
6+
"search.exclude": {
7+
"out": true // set this to false to include "out" folder in search results
8+
},
9+
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
10+
"typescript.tsc.autoDetect": "off"
11+
}

Diff for: .vscode/tasks.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// See https://go.microsoft.com/fwlink/?LinkId=733558
2+
// for the documentation about the tasks.json format
3+
{
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"type": "npm",
8+
"script": "watch",
9+
"problemMatcher": "$tsc-watch",
10+
"isBackground": true,
11+
"presentation": {
12+
"reveal": "never"
13+
},
14+
"group": {
15+
"kind": "build",
16+
"isDefault": true
17+
}
18+
}
19+
]
20+
}

Diff for: .vscodeignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.vscode/**
2+
.vscode-test/**
3+
out/test/**
4+
src/**
5+
.gitignore
6+
vsc-extension-quickstart.md
7+
**/tsconfig.json
8+
**/tslint.json
9+
**/*.map
10+
**/*.ts

Diff for: CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Change Log
2+
3+
All notable changes to the "payara-vscode" extension will be documented in this file.
4+
5+
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
6+
7+
## [Unreleased]
8+
9+
- Initial release

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Payara Tools for VS Code README

Diff for: nbproject/project.properties

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
file.reference.ecosystem-vscode-plugin-src=src
2+
file.reference.src-main=src/main
3+
file.reference.src-test=src/test
4+
files.encoding=UTF-8
5+
source.folder=${file.reference.src-main}
6+
test.folder=${file.reference.src-test}

Diff for: nbproject/project.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://www.netbeans.org/ns/project/1">
3+
<type>org.netbeans.modules.web.clientproject</type>
4+
<configuration>
5+
<data xmlns="http://www.netbeans.org/ns/clientside-project/1">
6+
<name>payara-vscode</name>
7+
</data>
8+
</configuration>
9+
</project>

Diff for: package.json

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "payara-vscode",
3+
"displayName": "Payara VSCode",
4+
"description": "Payara Tools for Visual Studio Code",
5+
"version": "0.0.1",
6+
"engines": {
7+
"vscode": "^1.40.0"
8+
},
9+
"categories": [
10+
"Other"
11+
],
12+
"activationEvents": [
13+
"onCommand:extension.helloWorld"
14+
],
15+
"main": "./out/extension.js",
16+
"contributes": {
17+
"commands": [{
18+
"command": "extension.helloWorld",
19+
"title": "Hello World"
20+
}]
21+
},
22+
"scripts": {
23+
"vscode:prepublish": "yarn run compile",
24+
"compile": "tsc -p ./",
25+
"watch": "tsc -watch -p ./",
26+
"pretest": "yarn run compile",
27+
"test": "node ./out/test/runTest.js"
28+
},
29+
"devDependencies": {
30+
"@types/glob": "^7.1.1",
31+
"@types/mocha": "^5.2.7",
32+
"@types/node": "^12.11.7",
33+
"@types/vscode": "^1.40.0",
34+
"glob": "^7.1.5",
35+
"mocha": "^6.2.2",
36+
"typescript": "^3.6.4",
37+
"tslint": "^5.20.0",
38+
"vscode-test": "^1.2.2"
39+
}
40+
}

Diff for: src/extension.ts

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// The module 'vscode' contains the VS Code extensibility API
2+
// Import the module and reference it with the alias vscode in your code below
3+
import * as vscode from 'vscode';
4+
5+
// this method is called when your extension is activated
6+
// your extension is activated the very first time the command is executed
7+
export function activate(context: vscode.ExtensionContext) {
8+
9+
// Use the console to output diagnostic information (console.log) and errors (console.error)
10+
// This line of code will only be executed once when your extension is activated
11+
console.log('Congratulations, your extension "payara-vscode" is now active!');
12+
13+
// The command has been defined in the package.json file
14+
// Now provide the implementation of the command with registerCommand
15+
// The commandId parameter must match the command field in package.json
16+
let disposable = vscode.commands.registerCommand('extension.helloWorld', () => {
17+
// The code you place here will be executed every time your command is executed
18+
19+
// Display a message box to the user
20+
vscode.window.showInformationMessage('Hello World!');
21+
});
22+
23+
context.subscriptions.push(disposable);
24+
}
25+
26+
// this method is called when your extension is deactivated
27+
export function deactivate() {}

Diff for: src/test/runTest.ts

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import * as path from 'path';
2+
3+
import { runTests } from 'vscode-test';
4+
5+
async function main() {
6+
try {
7+
// The folder containing the Extension Manifest package.json
8+
// Passed to `--extensionDevelopmentPath`
9+
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
10+
11+
// The path to test runner
12+
// Passed to --extensionTestsPath
13+
const extensionTestsPath = path.resolve(__dirname, './suite/index');
14+
15+
// Download VS Code, unzip it and run the integration test
16+
await runTests({ extensionDevelopmentPath, extensionTestsPath });
17+
} catch (err) {
18+
console.error('Failed to run tests');
19+
process.exit(1);
20+
}
21+
}
22+
23+
main();

Diff for: src/test/suite/extension.test.ts

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import * as assert from 'assert';
2+
3+
// You can import and use all API from the 'vscode' module
4+
// as well as import your extension to test it
5+
import * as vscode from 'vscode';
6+
// import * as myExtension from '../extension';
7+
8+
suite('Extension Test Suite', () => {
9+
vscode.window.showInformationMessage('Start all tests.');
10+
11+
test('Sample test', () => {
12+
assert.equal(-1, [1, 2, 3].indexOf(5));
13+
assert.equal(-1, [1, 2, 3].indexOf(0));
14+
});
15+
});

Diff for: src/test/suite/index.ts

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import * as path from 'path';
2+
import * as Mocha from 'mocha';
3+
import * as glob from 'glob';
4+
5+
export function run(): Promise<void> {
6+
// Create the mocha test
7+
const mocha = new Mocha({
8+
ui: 'tdd',
9+
});
10+
mocha.useColors(true);
11+
12+
const testsRoot = path.resolve(__dirname, '..');
13+
14+
return new Promise((c, e) => {
15+
glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
16+
if (err) {
17+
return e(err);
18+
}
19+
20+
// Add files to the test suite
21+
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
22+
23+
try {
24+
// Run the mocha test
25+
mocha.run(failures => {
26+
if (failures > 0) {
27+
e(new Error(`${failures} tests failed.`));
28+
} else {
29+
c();
30+
}
31+
});
32+
} catch (err) {
33+
e(err);
34+
}
35+
});
36+
});
37+
}

Diff for: tsconfig.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"target": "es6",
5+
"outDir": "out",
6+
"lib": [
7+
"es6"
8+
],
9+
"sourceMap": true,
10+
"rootDir": "src",
11+
"strict": true /* enable all strict type-checking options */
12+
/* Additional Checks */
13+
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
14+
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
15+
// "noUnusedParameters": true, /* Report errors on unused parameters. */
16+
},
17+
"exclude": [
18+
"node_modules",
19+
".vscode-test"
20+
]
21+
}

Diff for: tslint.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"rules": {
3+
"no-string-throw": true,
4+
"no-unused-expression": true,
5+
"no-duplicate-variable": true,
6+
"curly": true,
7+
"class-name": true,
8+
"semicolon": [
9+
true,
10+
"always"
11+
],
12+
"triple-equals": true
13+
},
14+
"defaultSeverity": "warning"
15+
}

0 commit comments

Comments
 (0)