forked from OpenLiberty/liberty-tools-vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProblemsPage.ts
More file actions
29 lines (24 loc) · 924 Bytes
/
Copy pathProblemsPage.ts
File metadata and controls
29 lines (24 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
* IBM Confidential
* Copyright IBM Corp. 2026
*/
import { BottomBarPanel, MarkerType } from 'vscode-extension-tester';
export class ProblemsPage {
/*
* Verify that the problems view contains a marker with the given message.
*/
async hasDiagnostic(message: string, markerType: MarkerType = MarkerType.Any) : Promise<boolean> {
const bottomBar = new BottomBarPanel();
await bottomBar.toggle(true);
let problemsView = await bottomBar.openProblemsView();
let markers = await problemsView.getAllVisibleMarkers(markerType);
for (const marker of markers) {
const text = await marker.getText();
// Check if text contains your diagnostic message
if(text.includes(message)){
return true;
}
}
return false;
}
}