Skip to content

Commit

Permalink
chore: debug api
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Feb 23, 2024
1 parent 785de7f commit 6524cda
Show file tree
Hide file tree
Showing 10 changed files with 592 additions and 82 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"@types/glob": "^7.2.0",
"@types/micromatch": "^4.0.6",
"@types/node": "^18.11.18",
"@types/node-ipc": "^9.2.3",
"@types/semver": "^7.3.9",
"@types/vscode": "^1.77.0",
"@types/ws": "^8.5.10",
Expand All @@ -182,6 +183,7 @@
"glob": "^7.2.0",
"micromatch": "^4.0.5",
"mighty-promise": "^0.0.8",
"node-ipc": "^11.1.0",
"pathe": "^1.1.2",
"semver": "^7.3.5",
"tree-kill": "^1.2.2",
Expand Down
172 changes: 172 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/TestData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,24 +88,24 @@ export class TestFile {
pattern = ''
children: (TestDescribe | TestCase)[] = []
constructor(public item: vscode.TestItem) {}
public async updateFromDisk(controller: vscode.TestController) {
public async updateFromDisk(controller: vscode.TestController, folder?: vscode.WorkspaceFolder) {
const item = this.item
try {
const content = await getContentFromFilesystem(item.uri!)
this.item.error = undefined
discoverTestFromFileContent(controller, content, item, this)
discoverTestFromFileContent(controller, content, item, this, folder || WEAKMAP_TEST_FOLDER.get(item)!)
this.resolved = true
}
catch (e) {
this.item.error = (e as Error).stack
}
}

load(ctrl: vscode.TestController): Promise<void> | undefined {
load(ctrl: vscode.TestController, folder: vscode.WorkspaceFolder): Promise<void> | undefined {
if (this.resolved)
return

return this.updateFromDisk(ctrl)
return this.updateFromDisk(ctrl, folder)
}

getFullPattern(): string {
Expand Down
Loading

0 comments on commit 6524cda

Please sign in to comment.