Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
kanej committed Jan 13, 2025
1 parent 3c0bd13 commit 13847f6
Show file tree
Hide file tree
Showing 22 changed files with 184 additions and 38 deletions.
176 changes: 151 additions & 25 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"url": "https://github.com/NomicFoundation/hardhat-vscode/issues"
},
"scripts": {
"build": "tsc -b ./client/tsconfig.json && tsc -b ./server/tsconfig.build.json && tsc -b ./coc/tsconfig.json && tsc -b",
"build": "tsc -b ./client/tsconfig.json && tsc -b ./server/tsconfig.build.json && tsc -b ./coc/tsconfig.json",
"watch": "concurrently -n client,server \"tsc -b -w ./client/tsconfig.json\" \"tsc -b -w ./server/tsconfig.build.json\"",
"test:unit": "npm -w server run test",
"test:protocol": "npm -w test/protocol run test",
"test:e2e": "npm run build && node ./out/test/runTests.js",
"test:e2e": "npm -w test/e2e run test",
"test": "npm run test:unit && npm run test:protocol && npm run test:e2e",
"test:coverage": "npm -w server run test:coverage",
"test:codecov": "npm -w server run test:codecov",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class MarkContractAbstract {
{ document, uri }: ResolveActionsContext
): CodeAction | null {
const contractToken = tokens.find(
(t) => "Keyword" && t.value === "contract"
(t) => t.type === "Keyword" && t.value === "contract"
);

if (contractToken === undefined || contractToken.range === undefined) {
Expand Down
1 change: 1 addition & 0 deletions server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"declaration": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"paths": {
"@compilerDiagnostics/*": ["./src/compilerDiagnostics/*"],
"@analyzer/*": ["./src/parser/analyzer/*"],
Expand Down
1 change: 1 addition & 0 deletions test/e2e/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
out
4 changes: 3 additions & 1 deletion test/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "1.0.0",
"private": true,
"scripts": {
"postinstall": "cd ./projects/main && npm install"
"postinstall": "cd ./projects/main && npm install",
"pretest": "tsc -b .",
"test": "node ./out/runTests.js"
}
}
File renamed without changes.
4 changes: 2 additions & 2 deletions test/e2e/tests/commands/clean.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import assert from "assert";
import { existsSync, mkdirSync } from "fs";
import path from "path";
import * as vscode from "vscode";
import { waitForUI } from "../../helpers/editor";
import { getRootPath } from "../../helpers/workspace";
import { waitForUI } from "../helpers/editor";
import { getRootPath } from "../helpers/workspace";

suite("task - clean", function () {
test("run clean task", async () => {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/tests/commands/flatten.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import assert from "assert";
import * as vscode from "vscode";
import { getTestContractUri } from "../../helpers/getTestContract";
import { openFileInEditor, waitForUI } from "../../helpers/editor";
import { getTestContractUri } from "../helpers/getTestContract";
import { openFileInEditor, waitForUI } from "../helpers/editor";

suite("commands - flatten", function () {
test("flatten via command palette", async () => {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions test/e2e/tests/language-configuration/onEnterRules.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as assert from "assert";
import { joinLines } from "../../helpers/joinLines";
import { CURSOR, withRandomFileEditor } from "../../helpers/editor";
import { type } from "../../helpers/commands";
import { joinLines } from "../helpers/joinLines";
import { CURSOR, withRandomFileEditor } from "../helpers/editor";
import { type } from "../helpers/commands";

suite("onEnterRules", function () {
test("[onEnterRules] - Multi line comment - first line with closing", async () => {
Expand Down
7 changes: 5 additions & 2 deletions test/runTests.ts → test/e2e/tests/runTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ import { runTests } from "@vscode/test-electron";
__dirname,
"..",
"..",
"..",
"client"
);

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

const folder = path.resolve(__dirname, "..", "..", "..", "test", "e2e");

const folder = path.resolve(__dirname, "..", "..", "test", "e2e");
console.log("------------> folder", folder);

Check warning on line 22 in test/e2e/tests/runTests.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Unexpected console statement

Check warning on line 22 in test/e2e/tests/runTests.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Unexpected console statement

Check warning on line 22 in test/e2e/tests/runTests.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Unexpected console statement

// Download VS Code, unzip it and run the e2e test
await runTests({
Expand Down
13 changes: 13 additions & 0 deletions test/e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"module": "commonjs" /* Specify what module code is generated. */,
"resolveJsonModule": true /* Enable importing .json files. */,
"outDir": "./out" /* Specify an output folder for all emitted files. */,
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
"strict": true /* Enable all strict type-checking options. */,
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"include": ["tests"]
}

0 comments on commit 13847f6

Please sign in to comment.