Skip to content
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
2 changes: 1 addition & 1 deletion vscode-rivet/.vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ src/**
node_modules/**
.vscode/**
tsconfig.json
bin/**
bin/esbuild.js
**/*.ts
**/*.map
8 changes: 5 additions & 3 deletions vscode-rivet/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,22 +199,24 @@ 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,
});
const firstLine = result.split('\n')[0];
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);
Expand Down
6 changes: 3 additions & 3 deletions vscode-rivet/src/test/suite/index.ts
Original file line number Diff line number Diff line change
@@ -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<void> {
const mocha = new Mocha({ ui: 'tdd', color: true, timeout: 30000 });
Expand All @@ -11,7 +11,7 @@ export function run(): Promise<void> {
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 {
Expand Down
Loading