diff --git a/vscode/package.json b/vscode/package.json index 1006e2e..b15799c 100644 --- a/vscode/package.json +++ b/vscode/package.json @@ -281,7 +281,7 @@ }, { "command": "auxon.specs.showVersion", - "when": "view == auxon.specs && viewItem == specVersion && !listMultiSelection && false", + "when": "view == auxon.specs && viewItem == specVersion && !listMultiSelection", "group": "1_context@1" }, { diff --git a/vscode/src/main.ts b/vscode/src/main.ts index 1cc39fa..7b533fd 100644 --- a/vscode/src/main.ts +++ b/vscode/src/main.ts @@ -88,7 +88,10 @@ export async function activate(context: vscode.ExtensionContext) { eventsProvider.setSelectedTimelines(selection); }); - new specs.SpecsTreeDataProvider(apiClient, specCoverageProvider, wss, context); + const specsProvider = new specs.SpecsTreeDataProvider(apiClient, specCoverageProvider, wss, context); + // Pre-load specs provided so that the deviant panel can reveal spec tree items without having the user + // explicitly load the specs panel first + const _ignored = specsProvider.getChildren(); new mutators.MutatorsTreeDataProvider(apiClient, wss, context); new mutations.MutationsTreeDataProvider(apiClient, wss, context); diff --git a/vscode/src/specFileCommands.ts b/vscode/src/specFileCommands.ts index 5dac11f..8b67148 100644 --- a/vscode/src/specFileCommands.ts +++ b/vscode/src/specFileCommands.ts @@ -228,3 +228,26 @@ export function runConformEvalCommand(args: SpecEvalCommandArgs): Thenable { + const conform = config.toolPath("conform"); + + try { + const res = await execFile( + conform, + ["spec", "inspect", "--with-speqtr", "--format", "json", specNameOrVersion], + { + encoding: "utf8", + } + ); + const data = JSON.parse(res.stdout); + return data.target_version.content.speqtr; + } catch (e: any /* eslint-disable-line @typescript-eslint/no-explicit-any */) { + if (Object.prototype.hasOwnProperty.call(e, "stderr")) { + vscode.window.showErrorMessage(e.stderr.trim()); + } else { + vscode.window.showErrorMessage(e.toString()); + } + return undefined; + } +} diff --git a/vscode/src/specs.ts b/vscode/src/specs.ts index 8fcde2c..b3fd57d 100644 --- a/vscode/src/specs.ts +++ b/vscode/src/specs.ts @@ -72,6 +72,12 @@ export class SpecsTreeDataProvider implements vscode.TreeDataProvider this.evalVersionDryRun(item) ), + vscode.commands.registerCommand("auxon.specs.showLatest", (item: NamedSpecTreeItemData) => + this.showLatest(item) + ), + vscode.commands.registerCommand("auxon.specs.showVersion", (item: SpecVersionTreeItemData) => + this.showVersion(item) + ), vscode.commands.registerCommand("auxon.specs.delete", (item: NamedSpecTreeItemData) => this.deleteSpec(item) ), @@ -203,6 +209,14 @@ export class SpecsTreeDataProvider implements vscode.TreeDataProvider