Repository navigation
Offer Xdebug setup for Sublime Text, with its project file kept out of the patch - #791
Open
ryanwelcher wants to merge 6 commits into
Open
ryanwelcher wants to merge 6 commits into
ryanwelcher wants to merge 6 commits into
Conversation
Sublime Text's Debugger package runs the same Xdebug adapter as VS Code, configured in a .sublime-project. The setup gives a whole project file, naming the site's folder by its full path so it can be saved outside the checkout, and its first step says Node.js is required, with the node setting as the fix when Sublime opened from the Dock cannot find it. Fixes #758.
…s macOS's Preferences: Debugger Settings is a command palette entry the Debugger package adds, not an item in Sublime's Preferences menu, and exists only once the package is installed. which node does not exist on Windows, where restarting Sublime after installing Node is the fix. Also adds Sublime Text to the README's list of editors.
A fresh Sublime Text has no Package Control, so Package Control: Install Package is not in the command palette. Sublime Text 4's own Install Package Control command adds it.
The Xdebug setup asked for the .sublime-project to be saved outside the site's folder. It now goes in the site's folder, like VS Code's and Zed's files, and opens it as '.'. A block of its own in .git/info/exclude keeps *.sublime-project and the .sublime-workspace Sublime writes beside it out of a patch, so sites seeded before this get it too.
The Sublime Text Xdebug setup walked through installing Package Control, the Debugger package, its PHP adapter and Node.js, and how to fix Node not being found. That is the package's to explain, so the dialog now says what the package needs, links to its setup guide, and keeps only this site's project file and how to start it. The file now has a name, xdebug.sublime-project, since a file named only .sublime-project is hidden on macOS and Open Project cannot choose it. The last step says to choose Listen for Xdebug when play asks, since the Debugger selects no configuration by itself.
…ately The comment said the package's README covers what to do when its setup fails. It does not cover the node setting that fixes a Sublime opened from the Dock not finding Node, which the dialog leaves out on purpose.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A contributor who uses Sublime Text has no Xdebug setup in the app: the setup menu offers VS Code, Cursor, PhpStorm and Zed only. #758 settled on offering it, with Node.js named as a requirement, since Sublime's Debugger package runs its PHP adapter on Node.
What changes
.sublime-projectwith adebugger_configurationsentry for the Debugger package's PHP adapter: the same listener (127.0.0.1:9003) and path mapping as the launch.json, with the project's folder as"."..vscode/launch.jsonand.zed/debug.json, and stays out of the patch. A new block in each site's.git/info/excludecovers/*.sublime-projectand the/*.sublime-workspaceSublime writes beside it. It is a block of its own because the editor-folders block is written only once (Changed files lists editor folders like .idea, and sometimes far more files than expected #737), so new rules there would never reach existing sites.xdebug.sublime-projectand open it with Project → Open Project; press play, choose Listen for Xdebug, press play again.nodesetting for a Sublime opened from the macOS Dock that cannot find an nvm or Homebrew Node. See Risks.How to test this
Platforms: any. macOS is where the Node
PATHcase below shows up. Use the Buildkite artifact for the current head.Starting state: Sublime Text 4 with Node.js installed, an existing Gutenberg (plugin) site and an existing Core site, both created before this build, and Xdebug turned on in Settings.
/wordpress/wp-content/plugins/gutenbergto the site's folder.xdebug.sublime-project, and open it with Project → Open Project./wordpressto the site'ssrcfolder.What must not have happened:
xdebug.sublime-projectorxdebug.sublime-workspacein the changed files or the patch, on either site, though both sites were created before this build."node"to the output ofwhich nodein Preferences: Debugger Settings fixes it.Covered by tests: the config shape (unit, both path styles and both serve strategies), the exclude on a site created before this change (
ipc-wiring, red without the new block), and the menu, dialog text, link and file contents (thexdebug.spec.jsjourney). A real Sublime connecting to Xdebug was tested by hand on macOS only.Risks and limitations
PATHfix on macOS is left to the user. The self-review flagged this (1 finding, deferred by decision): Sublime opened from the Dock does not get the shell'sPATH, so an nvm or Homebrew Node is "not found", and the Debugger's error points to nodejs.org. Neither the package's README nor this dialog mentions thenodesetting that fixes it. This was a deliberate call to keep troubleshooting a third-party package out of the app; it changes what the Offer Xdebug setup for Sublime Text #758 comment asked for.Related
Fixes #758. Follows #723 and #767.
Design decisions and alternatives considered
nodesetting). Built first, then cut. Testing it by hand showed it turning into troubleshooting for a third-party package..sublime-project. An earlier wording invited it. macOS hides a file whose name starts with a dot, so Open Project cannot choose it. The dialog now gives a full name.PATHfrom a Sublime opened from the Dock, and a wrong "Node found" is worse than no check.Review outcome (required — see AGENTS.md)
1 [fix here] · 0 [follow-up]: deferred by decision (see Risks)..github/instructions/code-review.instructions.md. Reviewed headda6c589/ base60e9d96(origin/trunk).npm run lintclean;npm test2315 pass, 0 fail, 9 skipped; thexdebug.spec.jsjourney 5/5, run hidden.xdebug-setup-dialog.jsx: no mention of thenodesetting for a Sublime opened from the macOS Dock. Deferred: the app does not troubleshoot the Debugger package.site:statusbefore the dialog can open;"."with absolute WindowspathMappings; the link goes throughurl:openand its allow-list; no branching logic in the.jsx.docs/guide/editors.mdand thesrc/exclude-file.cjsheader do not list the new block;ensureLocalExcludes's@returnwording (no caller reads it).da6c589 → c7c9f4echecked. It changes only a code comment, which wrongly said the package's README covers what to do when setup fails.Screenshots or recording
To add: the Sublime Text setup dialog.
🤖 Generated with Claude Code