Skip to content
Draft
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
24 changes: 0 additions & 24 deletions editors/vscode/.eslintrc.json

This file was deleted.

42 changes: 42 additions & 0 deletions editors/vscode/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import stylistic from '@stylistic/eslint-plugin';


/** @type {import('eslint').Linter.Config[]} */
export default [
{
ignores: [
'**/.vscode-test',
'**/out',
]
},
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
{
plugins: {
'@stylistic': stylistic
},
rules: {
'curly': 'warn',
'@stylistic/semi': ['warn', 'always'],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/naming-convention': [
'warn',
{
'selector': 'import',
'format': ['camelCase', 'PascalCase']
}
],
'@typescript-eslint/no-unused-vars': [
'error',
{
'argsIgnorePattern': '^_'
}
]
}
}
];
10 changes: 6 additions & 4 deletions editors/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,24 @@
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "yarn run compile && yarn run lint",
"lint": "eslint src --ext ts",
"lint": "eslint",
"test": "node ./out/test/runTest.js"
},
"devDependencies": {
"@eslint/js": "^9.16.0",
"@stylistic/eslint-plugin": "^2.11.0",
"@types/glob": "^8.0.1",
"@types/mocha": "^10.0.9",
"@types/node": "16.x",
"@types/vscode": "^1.68.0",
"@typescript-eslint/eslint-plugin": "^8.9.0",
"@typescript-eslint/parser": "^8.9.0",
"@vscode/test-electron": "^2.4.1",
"eslint": "^9.12.0",
"eslint": "^9.16.0",
"glob": "^8.1.0",
"globals": "^15.13.0",
"mocha": "^10.0.0",
"ovsx": "^0.10.0",
"typescript": "^4.9.5",
"typescript-eslint": "^8.16.0",
"vsce": "^2.15.0"
},
"dependencies": {
Expand Down
8 changes: 4 additions & 4 deletions editors/vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function activate(_context: ExtensionContext) {
console.log("YARA vscode initialization");

workspace.onDidChangeConfiguration((event) => {
let langServerAffected = event.affectsConfiguration("yls.executablePath");
const langServerAffected = event.affectsConfiguration("yls.executablePath");
if (langServerAffected) {
restartLanguageClient();
}
Expand All @@ -30,9 +30,9 @@ async function restartLanguageClient(): Promise<void> {
const config = workspace.getConfiguration("yls");
console.log("YLS configuration ", config);

let execPath: string =
const execPath: string =
process.env.YLS_EXECUTABLE_PATH || config.get("executablePath") || "yls";
let execArgs: Array<string> = ["-vv"];
const execArgs: string[] = ["-vv"];

console.log("Exec path: ", execPath);
console.log("Exec args: ", execArgs);
Expand All @@ -44,7 +44,7 @@ async function restartLanguageClient(): Promise<void> {
};

// Register the server for yara files
let clientOptions: LanguageClientOptions = {
const clientOptions: LanguageClientOptions = {
documentSelector: [{ scheme: "file", language: "yara" }],
};

Expand Down
31 changes: 18 additions & 13 deletions editors/vscode/src/test/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,26 @@ import * as path from 'path';
import { runTests } from '@vscode/test-electron';

async function main() {
try {
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
const extensionDevelopmentPath = path.resolve(__dirname, '../../');

// The path to test runner
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, './suite/index');
console.log("TESTS are disabled, skipping...");
return;

// Download VS Code, unzip it and run the integration test
await runTests({ extensionDevelopmentPath, extensionTestsPath });
} catch (err) {
console.error('Failed to run tests');
process.exit(1);
}
try {
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
const extensionDevelopmentPath = path.resolve(__dirname, '../../');

// The path to test runner
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, './suite/index');

// Download VS Code, unzip it and run the integration test
await runTests({ extensionDevelopmentPath, extensionTestsPath });
} catch (err) {
console.error('Failed to run tests');
console.error(err);
process.exit(1);
}
}

main();
Loading