Skip to content

Commit 5bc1600

Browse files
author
Kenneth Shepherd
committed
Merge branch 'daimor-master'
2 parents 5c88bbf + c4a27d0 commit 5bc1600

File tree

9 files changed

+171
-99
lines changed

9 files changed

+171
-99
lines changed

.github/main.workflow

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
workflow "Build, Lint and Package" {
22
on = "push"
3-
resolves = ["Package", "Lint"]
3+
resolves = ["Package"]
44
}
55

66
action "Build" {
@@ -9,13 +9,19 @@ action "Build" {
99
}
1010

1111
action "Lint" {
12-
needs = "Build"
12+
needs = ["Build"]
1313
uses = "actions/npm@master"
14-
args = "lint"
14+
args = "run lint"
15+
}
16+
17+
action "Test" {
18+
needs = ["Build"]
19+
uses = "actions/npm@master"
20+
args = "test"
1521
}
1622

1723
action "Package" {
18-
needs = "Build"
24+
needs = ["Test", "Lint"]
1925
uses = "actions/npm@master"
20-
args = "package"
26+
args = "run package"
2127
}

.vscode/launch.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212
"sourceMaps": true,
1313
"outFiles": ["${workspaceRoot}/out/**/*.js"],
1414
"preLaunchTask": "npm"
15+
},
16+
{
17+
"name": "Extension Tests",
18+
"type": "extensionHost",
19+
"request": "launch",
20+
"runtimeExecutable": "${execPath}",
21+
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "--extensionTestsPath=${workspaceFolder}/out/test"],
22+
"outFiles": ["${workspaceFolder}/out/test/**/*.js"],
23+
"preLaunchTask": "npm"
1524
}
1625
]
1726
}

package-lock.json

Lines changed: 95 additions & 82 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,16 +455,18 @@
455455
}
456456
},
457457
"scripts": {
458-
"vscode:prepublish": "tsc -p ./",
458+
"vscode:prepublish": "npm run compile",
459459
"package": "vsce package",
460460
"compile": "tsc -p ./",
461461
"watch": "tsc -w -p ./tsconfig.json",
462-
"lint": "tslint --project tsconfig.json -t verbose",
462+
"test": "npm run compile && node ./node_modules/vscode/bin/test",
463+
"lint": "node ./node_modules/tslint/bin/tslint --project tsconfig.json -t verbose",
463464
"lint-fix": "tslint --project tsconfig.json -t verbose --fix",
464465
"postinstall": "node ./node_modules/vscode/bin/install"
465466
},
466467
"devDependencies": {
467468
"@types/glob": "^7.1.1",
469+
"@types/mocha": "^5.2.5",
468470
"@types/node": "^10.12.15",
469471
"eslint": "^5.10.0",
470472
"tape": "^4.9.1",
@@ -476,6 +478,7 @@
476478
},
477479
"dependencies": {
478480
"bottleneck": "^2.16.2",
479-
"glob": "^7.1.3"
481+
"glob": "^7.1.3",
482+
"vscode-cache": "^0.3.0"
480483
}
481484
}

providers/ObjectScriptDefinitionProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class ObjectScriptDefinitionProvider implements vscode.DefinitionProvider
1818
return fromClassRef;
1919
}
2020

21-
let selfRef = document.getWordRangeAtPosition(position, /\.\.#?%?[a-zA-Z][a-zA-Z0-9]+(?:\.[a-zA-Z][a-zA-Z0-9]+)*/);
21+
let selfRef = document.getWordRangeAtPosition(position, /\.\.#?%?[a-zA-Z][a-zA-Z0-9]+/);
2222
if (selfRef) {
2323
let selfEntity = document.getText(selfRef).substr(2);
2424
let range = new vscode.Range(position.line, selfRef.start.character + 2, position.line, selfRef.end.character);

test/extension.test.ts

Lines changed: 15 additions & 0 deletions
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+
// Defines a Mocha test suite to group tests of similar kind together
9+
suite('Extension Tests', function() {
10+
// Defines a Mocha unit test
11+
test('Something 1', function() {
12+
assert.equal(-1, [1, 2, 3].indexOf(5));
13+
assert.equal(-1, [1, 2, 3].indexOf(0));
14+
});
15+
});

test/index.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
3+
//
4+
// This file is providing the test runner to use when running extension tests.
5+
// By default the test runner in use is Mocha based.
6+
//
7+
// You can provide your own test runner if you want to override it by exporting
8+
// a function run(testRoot: string, clb: (error:Error) => void) that the extension
9+
// host can call to run the tests. The test runner is expected to use console.log
10+
// to report the results back to the caller. When the tests are finished, return
11+
// a possible error to the callback or null if none.
12+
13+
import * as testRunner from 'vscode/lib/testrunner';
14+
15+
// You can directly control Mocha options by configuring the test runner below
16+
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options
17+
// for more info
18+
testRunner.configure({
19+
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
20+
useColors: true // colored output from test results
21+
});
22+
23+
module.exports = testRunner;

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
"sourceMap": true,
99
"rootDir": "."
1010
},
11-
"exclude": ["node_modules", ".vscode-test", "test"]
11+
"exclude": ["node_modules", ".vscode-test"]
1212
}

0 commit comments

Comments
 (0)