Skip to content

Commit 0194383

Browse files
committed
Skip tests for macos, implement progress indicator...
1 parent 5a37ab7 commit 0194383

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

src/extension.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,22 @@ export function activate(context: vscode.ExtensionContext) {
201201

202202
context.subscriptions.push(
203203
vscode.commands.registerCommand('extension.php-debug.pauseXdebugControlSocket', async () => {
204-
// check compat
205204
const controlSocket = new ControlSocket()
206-
const sockets = await controlSocket.listControlSockets()
205+
const sockets = await vscode.window.withProgress(
206+
{
207+
location: vscode.ProgressLocation.Window,
208+
title: 'Loading PHP processes...',
209+
},
210+
async progress => {
211+
progress.report({ increment: 0 })
207212

208-
// loading indicator
209-
if (sockets.length == 0) {
210-
await vscode.window.showInformationMessage('No Xdebug control sockets found...')
211-
return
212-
}
213+
const sockets = await controlSocket.listControlSockets()
214+
215+
progress.report({ increment: 100 })
213216

217+
return sockets
218+
}
219+
)
214220
const qpi = sockets.map<vscode.QuickPickItem>(
215221
v =>
216222
<vscode.QuickPickItem>{
@@ -219,7 +225,7 @@ export function activate(context: vscode.ExtensionContext) {
219225
detail: v.ps ? v.ps.fileUri : '',
220226
}
221227
)
222-
const i = await vscode.window.showQuickPick(qpi, { canPickMany: false })
228+
const i = await vscode.window.showQuickPick(qpi, { canPickMany: false, title: 'Select a PHP process...' })
223229
if (i) {
224230
await controlSocket.requestPause(i.label)
225231
}

src/test/controlSocket.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ControlSocket } from '../controlSocket'
33
import { assert } from 'chai'
44

55
describe('ControlSocket', () => {
6-
it('should try to get list of sockets', async () => {
6+
;(process.platform === 'darwin' ? it.skip : it)('should try to get list of sockets', async () => {
77
const cs = new ControlSocket()
88
const r = await cs.listControlSockets()
99
assert.isArray(r)

0 commit comments

Comments
 (0)