Skip to content

Commit 1755a21

Browse files
authored
Update windows-process-tree and correct types (microsoft#146362)
1 parent a632c11 commit 1755a21

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
"@vscode/windows-registry": "1.0.6",
226226
"windows-foreground-love": "0.4.0",
227227
"windows-mutex": "0.4.1",
228-
"windows-process-tree": "^0.3.2"
228+
"windows-process-tree": "0.3.3"
229229
},
230230
"resolutions": {
231231
"elliptic": "^6.5.3",

src/vs/base/node/ps.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ export function listProcesses(rootPid: number): Promise<ProcessItem> {
133133

134134
(import('windows-process-tree')).then(windowsProcessTree => {
135135
windowsProcessTree.getProcessList(rootPid, (processList) => {
136+
if (!processList) {
137+
reject(new Error(`Root process ${rootPid} not found`));
138+
return;
139+
}
136140
windowsProcessTree.getProcessCpuUsage(processList, (completeProcessList) => {
137141
const processItems: Map<number, ProcessItem> = new Map();
138142
completeProcessList.forEach(process => {

src/vs/platform/terminal/node/windowsShellHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class WindowsShellHelper extends Disposable implements IWindowsShellHelpe
132132
windowsProcessTree = await import('windows-process-tree');
133133
}
134134
this._currentRequest = new Promise<string>(resolve => {
135-
windowsProcessTree.getProcessTree(this._rootProcessId, (tree: any /* WindowsProcessTreeType.IProcessTreeNode | undefined */) => {
135+
windowsProcessTree.getProcessTree(this._rootProcessId, tree => {
136136
const name = this.traverseTree(tree);
137137
this._currentRequest = undefined;
138138
resolve(name);

src/vs/workbench/contrib/debug/node/terminals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export async function hasChildProcesses(processId: number | undefined): Promise<
3333
if (platform.isWindows) {
3434
const windowsProcessTree = await import('windows-process-tree');
3535
return new Promise<boolean>(resolve => {
36-
windowsProcessTree.getProcessTree(processId, (processTree: any /* IProcessTreeNode | undefined */) => {
36+
windowsProcessTree.getProcessTree(processId, processTree => {
3737
resolve(!!processTree && processTree.children.length > 0);
3838
});
3939
});

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12191,10 +12191,10 @@ [email protected]:
1219112191
bindings "^1.2.1"
1219212192
nan "^2.14.0"
1219312193

12194-
windows-process-tree@^0.3.2:
12195-
version "0.3.2"
12196-
resolved "https://registry.yarnpkg.com/windows-process-tree/-/windows-process-tree-0.3.2.tgz#8c39f39e7707e09fd74638a7ef644b5f389096d3"
12197-
integrity sha512-x8Y4KOV8tUhhPiO0TH7wOMTZ677rw7VEwq+dTuHHiLTClkrNXWSY3XzP6ez3fs2Cab4FajrtmiqRs0jTMZHfyw==
12194+
12195+
version "0.3.3"
12196+
resolved "https://registry.yarnpkg.com/windows-process-tree/-/windows-process-tree-0.3.3.tgz#7c178815f02bf4cfbcac1f93b2f3a3cc10bc9245"
12197+
integrity sha512-rkiAMP0AS27xikFyn7i4gPbOK16UdjY8X/C6eo37CnfNLqTvK2eEaT+Dh0e5xnvmlsi0lEKd60O+4ajzfDkq7A==
1219812198
dependencies:
1219912199
nan "^2.13.2"
1220012200

0 commit comments

Comments
 (0)