From 22f3b54dfaa30ab49cd04464b1d427e016e4e2e3 Mon Sep 17 00:00:00 2001 From: Auca Coyan Date: Sun, 24 Mar 2024 12:04:31 -0300 Subject: [PATCH 1/4] :wrench: add json formatter config --- .vscode/settings.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 940998a..eab6f7d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,5 +6,8 @@ "source.fixAll.eslint": "explicit" }, "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "esbenp.prettier-vscode", + "[jsonc]": { + "editor.defaultFormatter": "vscode.json-language-features" + } } \ No newline at end of file From a5d18022eaceddbaa6db3113e7a72131467c0f62 Mon Sep 17 00:00:00 2001 From: Auca Coyan Date: Sun, 24 Mar 2024 12:04:58 -0300 Subject: [PATCH 2/4] :white_check_mark: add simple test --- .vscode/launch.json | 11 +++++++---- package.json | 3 ++- testFixture/sample.nu | 1 + 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 testFixture/sample.nu diff --git a/.vscode/launch.json b/.vscode/launch.json index 95fb50d..c040d9c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,7 +7,10 @@ "request": "launch", "name": "Launch Client", "runtimeExecutable": "${execPath}", - "args": ["--extensionDevelopmentPath=${workspaceRoot}"], + "args": [ + "--extensionDevelopmentPath=${workspaceRoot}", + "--disable-extensions" + ], "preLaunchTask": { "type": "npm", "script": "compile" @@ -20,9 +23,9 @@ "runtimeExecutable": "${execPath}", "args": [ "--extensionDevelopmentPath=${workspaceRoot}", - "--extensionTestsPath=${workspaceRoot}/client/out/test/index", - "${workspaceRoot}/client/testFixture" + "--extensionTestsPath=${workspaceRoot}/out/client/test/index", + "${workspaceRoot}/client/src/test/testFixture" ] } ] -} +} \ No newline at end of file diff --git a/package.json b/package.json index 23d608a..5d73bd5 100644 --- a/package.json +++ b/package.json @@ -139,6 +139,7 @@ "install": "cd server && npm install && cd ../client && npm install && cd ..", "watch": "npm run esbuild-base -- --sourcemap --watch", "lint": "npx eslint ./client/src ./server/src --ext .ts,.tsx", + "compile:tests": "tsc -b", "test": "sh ./scripts/e2e.sh" }, "dependencies": { @@ -173,4 +174,4 @@ "color": "#008000", "theme": "light" } -} +} \ No newline at end of file diff --git a/testFixture/sample.nu b/testFixture/sample.nu new file mode 100644 index 0000000..60743ed --- /dev/null +++ b/testFixture/sample.nu @@ -0,0 +1 @@ +something; something = "nothing" \ No newline at end of file From fe2f8f8e595a622aaeda8dd932f941f2ea83f2f4 Mon Sep 17 00:00:00 2001 From: Auca Coyan Date: Sun, 24 Mar 2024 12:07:15 -0300 Subject: [PATCH 3/4] :truck: move the script --- {testFixture => client/src/test/testFixture}/sample.nu | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {testFixture => client/src/test/testFixture}/sample.nu (100%) diff --git a/testFixture/sample.nu b/client/src/test/testFixture/sample.nu similarity index 100% rename from testFixture/sample.nu rename to client/src/test/testFixture/sample.nu From 0742aeacd62e915b8efdb6f0ea371f52021b659b Mon Sep 17 00:00:00 2001 From: Auca Coyan Date: Sun, 24 Mar 2024 12:27:12 -0300 Subject: [PATCH 4/4] :construction: it compiles and fails the tests --- .vscode/launch.json | 8 ++++++-- client/src/test/helper.ts | 2 +- package-lock.json | 4 ++-- package.json | 4 +--- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index c040d9c..ed3ac30 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -23,9 +23,13 @@ "runtimeExecutable": "${execPath}", "args": [ "--extensionDevelopmentPath=${workspaceRoot}", - "--extensionTestsPath=${workspaceRoot}/out/client/test/index", + "--extensionTestsPath=${workspaceRoot}/client/out/test/index", "${workspaceRoot}/client/src/test/testFixture" - ] + ], + "preLaunchTask": { + "type": "npm", + "script": "compile:tests" + } } ] } \ No newline at end of file diff --git a/client/src/test/helper.ts b/client/src/test/helper.ts index 6e6724d..9ae12ad 100644 --- a/client/src/test/helper.ts +++ b/client/src/test/helper.ts @@ -16,7 +16,7 @@ export let platformEol: string; */ export async function activate(docUri: vscode.Uri) { // The extensionId is `publisher.name` from package.json - const ext = vscode.extensions.getExtension('vscode-samples.lsp-sample')!; + const ext = vscode.extensions.getExtension('TheNuProjectContributors.vscode-nushell-lang')!; await ext.activate(); try { doc = await vscode.workspace.openTextDocument(docUri); diff --git a/package-lock.json b/package-lock.json index 16f0eb8..b53baa0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vscode-nushell-lang", - "version": "1.7.1", + "version": "1.9.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vscode-nushell-lang", - "version": "1.7.1", + "version": "1.9.0", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 5d73bd5..9dfa305 100644 --- a/package.json +++ b/package.json @@ -23,9 +23,7 @@ "Programming Languages", "Snippets" ], - "activationEvents": [ - "onTerminalProfile:nushell_default" - ], + "activationEvents": [], "main": "out/client/src/extension.js", "contributes": { "languages": [