eclipse-cdt-cloud / eclipse-cdt-cloud/vscode-trace-extension

Command "traces.openTraceFile" - should it be available from command palette?

Open
#224 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11
Forks
33
Avg merge
2d 16h
Merged PRs (30d)
1

Description

ATM command "traces.openTraceFile" (label: "Open with Trace Viewer") is available in the command palette. However it seems to only work when triggered from the explorer's context menu, with a file selection. If triggered from the command palette, it seems to always fail, even if one selects the file before invocation. Should it even be available from the command palette?

The error message is rather cryptic too:

![image](https://github.com/eclipse-cdt-cloud/vscode-trace-extension/assets/25749063/01c98b1d-683b-491f-8731-5ac2bba8df14)

Maybe we could register the command using the "when" clause and use contexts to make it available only when appropriate. Here are some contexts that could potentially be used, with example values, when a trace file is selected in the explorer:
```
"focusedView": "workbench.explorer.fileView",
"workbench.explorer.fileView.active": true,
"resource": "file:///home/user/TraceCompassTutorialTraces/303-jaeger-opentracing-traces/donutJaegerTrace.json",
"resourceScheme": "file",
"resourceFilename": "donutJaegerTrace.json",
"workbench.explorer.fileView.active": true,
"explorerResourceIsFolder": false,
"filesExplorerFocus": true,
```

Failing that, we could at least adjust the error message to say how that command should be triggered?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.