Skip to content

Commit 5c6a849

Browse files
[CLI] Make messaging clearer for errors and Xdebug IDE integration (#2869)
## Motivation for the change, related issues This PR tweaks a couple of strings around Playground CLI messaging noticed by @fellyph and I while discussing Xdebug IDE integration documentation this afternoon,. ## Implementation details This PR: - Makes the message for an error with a `cause` a bit clearer by placing a ":" after "caused by". - Before: `Could not configure Xdebug caused by VS Code IDE integration requested, but no '.vscode' directory was found in the current working directory.` (reads a bit strange but seems like one message) - After: `Could not configure Xdebug caused by: VS Code IDE integration requested, but no '.vscode' directory was found in the current working directory.` (with the added colon, it is clearer we are talking about separate messages) - Adds the following lines to the VSCode IDE integration instructions: - "1. Ensure you have installed an IDE extension for PHP Debugging" - "(The **PHP Debug** extension by **Xdebug** has been a solid option)" ## Testing Instructions (or ideally a Blueprint) - CI
1 parent 11fb6b1 commit 5c6a849

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

packages/playground/cli/src/run-cli.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ export async function parseOptionsAndRunCLI() {
449449
currentError = currentError.cause as Error;
450450
} while (currentError instanceof Error);
451451
console.error(
452-
'\x1b[1m' + messageChain.join(' caused by ') + '\x1b[0m'
452+
'\x1b[1m' + messageChain.join(' caused by: ') + '\x1b[0m'
453453
);
454454
}
455455
process.exit(1);
@@ -713,19 +713,27 @@ export async function runCLI(args: RunCLIArgs): Promise<RunCLIServer | void> {
713713
if (hasVSCode) {
714714
console.log(bold('VS Code / Cursor instructions:'));
715715
console.log(
716-
' 1. Open the Run and Debug panel on the left sidebar'
716+
' 1. Ensure you have installed an IDE extension for PHP Debugging'
717717
);
718718
console.log(
719-
` 2. Select "${italic(
719+
` (The ${bold('PHP Debug')} extension by ${bold(
720+
'Xdebug'
721+
)} has been a solid option)`
722+
);
723+
console.log(
724+
' 2. Open the Run and Debug panel on the left sidebar'
725+
);
726+
console.log(
727+
` 3. Select "${italic(
720728
IDEConfigName
721729
)}" from the dropdown`
722730
);
723731
console.log(' 3. Click "start debugging"');
724732
console.log(
725-
' 4. Set a breakpoint. For example, in .playground-xdebug-root/wordpress/index.php'
733+
' 5. Set a breakpoint. For example, in .playground-xdebug-root/wordpress/index.php'
726734
);
727735
console.log(
728-
' 5. Visit Playground in your browser to hit the breakpoint'
736+
' 6. Visit Playground in your browser to hit the breakpoint'
729737
);
730738
if (hasPhpStorm) {
731739
console.log('');

0 commit comments

Comments
 (0)