diff --git a/vscode-rivet/.vscodeignore b/vscode-rivet/.vscodeignore index 32b84ee..d25e3b5 100644 --- a/vscode-rivet/.vscodeignore +++ b/vscode-rivet/.vscodeignore @@ -2,6 +2,6 @@ src/** node_modules/** .vscode/** tsconfig.json -bin/** +bin/esbuild.js **/*.ts **/*.map diff --git a/vscode-rivet/src/extension.ts b/vscode-rivet/src/extension.ts index 9843fba..c82634a 100644 --- a/vscode-rivet/src/extension.ts +++ b/vscode-rivet/src/extension.ts @@ -199,14 +199,16 @@ function showDashboard(context: vscode.ExtensionContext, path: string = '/') { viewColumn: vscode.ViewColumn.One, }); }); - } else if (message.artifactId && workspaceRoot) { + } else if (message.artifactId) { // No file path — search for the artifact by ID + const wsRoot = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath; + if (!wsRoot) return; try { const result = execFileSync('grep', [ '-rn', `id: ${message.artifactId}`, 'artifacts/', 'safety/', ], { - cwd: workspaceRoot, + cwd: wsRoot, encoding: 'utf8', timeout: 5000, }); @@ -214,7 +216,7 @@ function showDashboard(context: vscode.ExtensionContext, path: string = '/') { if (firstLine) { const match = firstLine.match(/^(.+):(\d+):/); if (match) { - const filePath = path.join(workspaceRoot, match[1]); + const filePath = wsRoot + '/' + match[1]; const lineNum = Math.max(0, parseInt(match[2], 10) - 1); const uri = vscode.Uri.file(filePath); const doc = await vscode.workspace.openTextDocument(uri); diff --git a/vscode-rivet/src/test/suite/index.ts b/vscode-rivet/src/test/suite/index.ts index 53d021d..c4e7beb 100644 --- a/vscode-rivet/src/test/suite/index.ts +++ b/vscode-rivet/src/test/suite/index.ts @@ -1,6 +1,6 @@ import * as path from 'path'; -import * as Mocha from 'mocha'; -import * as glob from 'glob'; +import Mocha from 'mocha'; +import { glob } from 'glob'; export function run(): Promise { const mocha = new Mocha({ ui: 'tdd', color: true, timeout: 30000 }); @@ -11,7 +11,7 @@ export function run(): Promise { files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f))); try { - mocha.run((failures) => { + mocha.run((failures: number) => { if (failures > 0) { reject(new Error(`${failures} tests failed.`)); } else {