Skip to content

Commit

Permalink
feat: select finding when opening from problems tab
Browse files Browse the repository at this point in the history
  • Loading branch information
ahtrotta committed Aug 31, 2023
1 parent 670570c commit 1cb8db8
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/diagnostics/findingsDiagnosticsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,21 @@ export default class FindingsDiagnosticsProvider implements vscode.Disposable {
findings.map((finding) => {
if (!finding.problemLocation) return;

const relatedInformation = finding.appMapUri
? [
new vscode.DiagnosticRelatedInformation(
new vscode.Location(finding.appMapUri, new vscode.Position(0, 0)),
'Open AppMap'
),
]
: [];
const relatedInformation = [] as vscode.DiagnosticRelatedInformation[];
if (finding.appMapUri) {
const uri = finding.appMapUri.with({
fragment: JSON.stringify({
selectedObject: `analysis-finding:${finding.finding.hash_v2}`,
}),
});

const diagnosticInfo = new vscode.DiagnosticRelatedInformation(
new vscode.Location(uri, new vscode.Position(0, 0)),
'Open AppMap'
);

relatedInformation.push(diagnosticInfo);
}

const problemUri = finding.problemLocation.uri;
updatedProblemUriStrings.add(problemUri.toString());
Expand Down

0 comments on commit 1cb8db8

Please sign in to comment.