Skip to content

Updates #755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@master
- uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
cache: yarn
- name: Compile extension
run: |
Expand All @@ -40,7 +40,7 @@ jobs:
- uses: actions/checkout@master
- uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
cache: yarn
- uses: ruby/setup-ruby@v1
with:
Expand Down
9 changes: 9 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import { defineConfig, globalIgnores } from "eslint/config";

export default defineConfig([
eslint.configs.recommended,
tseslint.configs.recommended,
globalIgnores([".vscode-test/", "out/"])
]);
46 changes: 11 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,12 @@
},
"packageManager": "yarn@1.22.19",
"engines": {
"vscode": "^1.68.0"
"vscode": "^1.75.0"
},
"activationEvents": [
"onLanguage:haml",
"onLanguage:ruby",
"workspaceContains:Gemfile.lock",
"onCommand:syntaxTree.start",
"onCommand:syntaxTree.stop",
"onCommand:syntaxTree.restart",
"onCommand:syntaxTree.showOutputChannel",
"onCommand:syntaxTree.visualize"
"workspaceContains:Gemfile.lock"
],
"main": "./out/extension",
"contributes": {
Expand Down Expand Up @@ -116,40 +111,21 @@
"vscode-languageclient": "9.0.1"
},
"devDependencies": {
"@types/glob": "^9.0.0",
"@eslint/js": "^9.31.0",
"@types/mocha": "^10.0.0",
"@types/node": "^24.0.0",
"@types/vscode": "^1.68.0",
"@typescript-eslint/eslint-plugin": "^5.47.0",
"@typescript-eslint/parser": "^5.47.0",
"@types/vscode": "^1.75.0",
"@typescript-eslint/eslint-plugin": "^8.37.0",
"@typescript-eslint/parser": "^8.37.0",
"@vscode/test-electron": "^2.2.0",
"@vscode/vsce": "^3.6.0",
"esbuild": "^0.25.0",
"eslint": "^9.12.0",
"eslint": "^9.31.0",
"glob": "^11.0.0",
"globals": "^16.3.0",
"mocha": "^11.0.1",
"typescript": "^5.0.2",
"vsce": "^2.9.2"
},
"eslintConfig": {
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"quotes": [
"error",
"double"
],
"semi": "error"
},
"ignorePatterns": [
"out"
]
"typescript": "=5.5.4",
"typescript-eslint": "^8.37.0"
},
"__metadata": {
"id": "b46118f9-0f6f-4320-9e2e-75c96492b4cb",
Expand Down
2 changes: 1 addition & 1 deletion src/test/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async function main() {

// Download VS Code, unzip it and run the integration test
await runTests({ extensionDevelopmentPath, extensionTestsPath, launchArgs: ["--disable-extensions", "--disable-gpu", "--user-data-dir", USER_DATA_DIR, WORKSPACE_DIR] });
} catch (err) {
} catch {
console.error("Failed to run tests");
process.exit(1);
}
Expand Down
51 changes: 25 additions & 26 deletions src/test/suite/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as path from "path";
import * as Mocha from "mocha";
import * as glob from "glob";
import { glob } from "glob";

import { TIMEOUT_MS } from "./setup";

export function run(): Promise<void> {
export async function run(): Promise<void> {
const mocha = new Mocha({
asyncOnly: true,
color: true,
Expand All @@ -16,33 +16,32 @@ export function run(): Promise<void> {

const testsRoot = path.resolve(__dirname, "..");

return new Promise((c, e) => {
glob("**/**.test.js", { cwd: testsRoot }, (err, files) => {
if (err) {
return e(err);
}
try {
// Find all test files
const files = await glob("**/**.test.js", { cwd: testsRoot });

// Add files to the test suite
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
// Add files to the test suite
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));

try {
// Run the mocha test
mocha.run(failures => {
if (failures > 0) {
// Let the cameras roll for a bit & make sure we capture the error
if (process.env.CI) {
setTimeout(() => e(new Error(`${failures} tests failed; pausing for dramatic effect.`)), 3000);
} else {
e(new Error(`${failures} tests failed.`));
}
// Run the mocha test and wrap in a promise since mocha.run uses callbacks
await new Promise<void>((resolve, reject) => {
mocha.run(failures => {
if (failures > 0) {
const error = new Error(`${failures} tests failed${process.env.CI ? '; pausing for dramatic effect.' : '.'}`);

// Let the cameras roll for a bit & make sure we capture the error
if (process.env.CI) {
setTimeout(() => reject(error), 3000);
} else {
c();
reject(error);
}
});
} catch (err) {
console.error(err);
e(err);
}
} else {
resolve();
}
});
});
});
} catch (err) {
console.error(err);
throw err;
}
}
Loading