Skip to content

Commit c18654d

Browse files
authored
docs: change case of Xdebug (#356)
1 parent 3c66f87 commit c18654d

File tree

10 files changed

+65
-65
lines changed

10 files changed

+65
-65
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ jobs:
4545
with:
4646
php-version: ${{ matrix.php }}
4747
extensions: ${{ matrix.xdebug }}
48-
# Top: XDebug v3
49-
# Bottom: XDebug v2
48+
# Top: Xdebug v3
49+
# Bottom: Xdebug v2
5050
ini-values: >-
5151
xdebug.mode = debug,
5252
xdebug.start_with_request = yes,

ISSUE_TEMPLATE.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
PHP version:
2-
XDebug version:
1+
PHP version:
2+
Xdebug version:
33
Adapter version:
44

5-
Your launch.json:
6-
XDebug php.ini config:
5+
Your launch.json:
6+
Xdebug php.ini config:
77

8-
XDebug logfile (from setting `xdebug.remote_log` in php.ini):
8+
Xdebug logfile (from setting `xdebug.remote_log` in php.ini):
99
Adapter logfile (from setting `"log": true` in launch.json):
1010

1111
Code snippet to reproduce:

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,20 @@ This extension is a debug adapter between VS Code and [Xdebug](https://xdebug.or
4646
In your project, go to the debugger and hit the little gear icon and choose _PHP_. A new launch configuration will be created for you with two configurations:
4747

4848
- **Listen for Xdebug**
49-
This setting will simply start listening on the specified port (by default 9000) for XDebug. If you configured XDebug like recommended above, everytime you make a request with a browser to your webserver or launch a CLI script Xdebug will connect and you can stop on breakpoints, exceptions etc.
49+
This setting will simply start listening on the specified port (by default 9000) for Xdebug. If you configured Xdebug like recommended above, everytime you make a request with a browser to your webserver or launch a CLI script Xdebug will connect and you can stop on breakpoints, exceptions etc.
5050
- **Launch currently open script**
5151
This setting is an example of CLI debugging. It will launch the currently opened script as a CLI, show all stdout/stderr output in the debug console and end the debug session once the script exits.
5252

5353
#### Supported launch.json settings:
5454

5555
- `request`: Always `"launch"`
56-
- `hostname`: The address to bind to when listening for XDebug (default: all IPv6 connections if available, else all IPv4 connections)
56+
- `hostname`: The address to bind to when listening for Xdebug (default: all IPv6 connections if available, else all IPv4 connections)
5757
- `port`: The port on which to listen for Xdebug (default: `9000`)
5858
- `stopOnEntry`: Whether to break at the beginning of the script (default: `false`)
5959
- `pathMappings`: A list of server paths mapping to the local source paths on your machine, see "Remote Host Debugging" below
6060
- `log`: Whether to log all communication between VS Code and the adapter to the debug console. See _Troubleshooting_ further down.
6161
- `ignore`: An optional array of glob patterns that errors should be ignored from (for example `**/vendor/**/*.php`)
62-
- `xdebugSettings`: Allows you to override XDebug's remote debugging settings to fine tuning XDebug to your needs. For example, you can play with `max_children` and `max_depth` to change the max number of array and object children that are retrieved and the max depth in structures like arrays and objects. This can speed up the debugger on slow machines.
62+
- `xdebugSettings`: Allows you to override Xdebug's remote debugging settings to fine tuning Xdebug to your needs. For example, you can play with `max_children` and `max_depth` to change the max number of array and object children that are retrieved and the max depth in structures like arrays and objects. This can speed up the debugger on slow machines.
6363
For a full list of feature names that can be set please refer to the [Xdebug documentation](https://xdebug.org/docs-dbgp.php#feature-names).
6464
- `max_children`: max number of array or object children to initially retrieve
6565
- `max_data`: max amount of variable data to initially retrieve.
@@ -132,4 +132,4 @@ VS Code will open an "Extension Development Host" with the debug adapter running
132132

133133
The extension is written in TypeScript. You can compile it through `npm run build`. `npm run watch` enables incremental compilation.
134134

135-
Tests are written with Mocha and can be run with `npm test`. The tests are run in CI on Linux, macOS and Windows against multiple PHP and XDebug versions.
135+
Tests are written with Mocha and can be run with `npm test`. The tests are run in CI on Linux, macOS and Windows against multiple PHP and Xdebug versions.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "0.0.0-development",
55
"publisher": "felixfbecker",
66
"license": "MIT",
7-
"description": "Debug support for PHP with XDebug",
7+
"description": "Debug support for PHP with Xdebug",
88
"keywords": [
99
"php",
1010
"debug",
@@ -196,12 +196,12 @@
196196
},
197197
"hostname": {
198198
"type": "string",
199-
"description": "Address to bind to when listening for XDebug",
199+
"description": "Address to bind to when listening for Xdebug",
200200
"default": "::"
201201
},
202202
"port": {
203203
"type": "number",
204-
"description": "Port on which to listen for XDebug",
204+
"description": "Port on which to listen for Xdebug",
205205
"default": 9000
206206
},
207207
"serverSourceRoot": {
@@ -250,15 +250,15 @@
250250
"description": "This feature can get set by the IDE if it wants to have more detailed internal information on properties (eg. private members of classes, etc.) Zero means that hidden members are not shown to the IDE"
251251
}
252252
},
253-
"description": "Overrides for XDebug remote debugging settings. See https://xdebug.org/docs-dbgp.php#feature-names",
253+
"description": "Overrides for Xdebug remote debugging settings. See https://xdebug.org/docs-dbgp.php#feature-names",
254254
"default": {}
255255
}
256256
}
257257
}
258258
},
259259
"initialConfigurations": [
260260
{
261-
"name": "Listen for XDebug",
261+
"name": "Listen for Xdebug",
262262
"type": "php",
263263
"request": "launch",
264264
"port": 9000

src/dbgp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { EventEmitter } from 'events'
33
import * as iconv from 'iconv-lite'
44
import { DOMParser } from 'xmldom'
55

6-
/** The encoding all XDebug messages are encoded with */
6+
/** The encoding all Xdebug messages are encoded with */
77
export const ENCODING = 'iso-8859-1'
88

99
/** The two states the connection switches between */

src/paths.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const RELATE_URL_OPTIONS: RelateUrl.Options = {
2323
*/
2424
const relativeUrl = (from: string, to: string): string => RelateUrl.relate(from, to, RELATE_URL_OPTIONS)
2525

26-
/** converts a server-side XDebug file URI to a local path for VS Code with respect to source root settings */
26+
/** converts a server-side Xdebug file URI to a local path for VS Code with respect to source root settings */
2727
export function convertDebuggerPathToClient(
2828
fileUri: string | url.Url,
2929
pathMapping?: { [index: string]: string }
@@ -71,11 +71,11 @@ export function convertDebuggerPathToClient(
7171
return localPath
7272
}
7373

74-
/** converts a local path from VS Code to a server-side XDebug file URI with respect to source root settings */
74+
/** converts a local path from VS Code to a server-side Xdebug file URI with respect to source root settings */
7575
export function convertClientPathToDebugger(localPath: string, pathMapping?: { [index: string]: string }): string {
7676
let localSourceRoot: string | undefined
7777
let serverSourceRoot: string | undefined
78-
// XDebug always lowercases Windows drive letters in file URIs
78+
// Xdebug always lowercases Windows drive letters in file URIs
7979
let localFileUri = fileUrl(
8080
localPath.replace(/^[A-Z]:\\/, match => match.toLowerCase()),
8181
{ resolve: false }

src/phpDebug.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ function formatPropertyValue(property: xdebug.BaseProperty): string {
5050
* This interface should always match the schema found in the mock-debug extension manifest.
5151
*/
5252
interface LaunchRequestArguments extends VSCodeDebugProtocol.LaunchRequestArguments {
53-
/** The address to bind to for listening for XDebug connections (default: all IPv6 connections if available, else all IPv4 connections) */
53+
/** The address to bind to for listening for Xdebug connections (default: all IPv6 connections if available, else all IPv4 connections) */
5454
hostname?: string
55-
/** The port where the adapter should listen for XDebug connections (default: 9000) */
55+
/** The port where the adapter should listen for Xdebug connections (default: 9000) */
5656
port?: number
5757
/** Automatically stop target after launch. If not specified, target does not stop. */
5858
stopOnEntry?: boolean
@@ -66,7 +66,7 @@ interface LaunchRequestArguments extends VSCodeDebugProtocol.LaunchRequestArgume
6666
log?: boolean
6767
/** Array of glob patterns that errors should be ignored from */
6868
ignore?: string[]
69-
/** XDebug configuration */
69+
/** Xdebug configuration */
7070
xdebugSettings?: { [featureName: string]: string | number }
7171

7272
// CLI options
@@ -91,15 +91,15 @@ class PhpDebugSession extends vscode.DebugSession {
9191
/** The arguments that were given to launchRequest */
9292
private _args: LaunchRequestArguments
9393

94-
/** The TCP server that listens for XDebug connections */
94+
/** The TCP server that listens for Xdebug connections */
9595
private _server: net.Server
9696

9797
/** The child process of the launched PHP script, if launched by the debug adapter */
9898
private _phpProcess?: childProcess.ChildProcess
9999

100100
/**
101-
* A map from VS Code thread IDs to XDebug Connections.
102-
* XDebug makes a new connection for each request to the webserver, we present these as threads to VS Code.
101+
* A map from VS Code thread IDs to Xdebug Connections.
102+
* Xdebug makes a new connection for each request to the webserver, we present these as threads to VS Code.
103103
* The threadId key is equal to the id attribute of the connection.
104104
*/
105105
private _connections = new Map<number, xdebug.Connection>()
@@ -110,34 +110,34 @@ class PhpDebugSession extends vscode.DebugSession {
110110
/** A counter for unique source IDs */
111111
private _sourceIdCounter = 1
112112

113-
/** A map of VS Code source IDs to XDebug file URLs for virtual files (dpgp://whatever) and the corresponding connection */
113+
/** A map of VS Code source IDs to Xdebug file URLs for virtual files (dpgp://whatever) and the corresponding connection */
114114
private _sources = new Map<number, { connection: xdebug.Connection; url: string }>()
115115

116116
/** A counter for unique stackframe IDs */
117117
private _stackFrameIdCounter = 1
118118

119-
/** A map from unique stackframe IDs (even across connections) to XDebug stackframes */
119+
/** A map from unique stackframe IDs (even across connections) to Xdebug stackframes */
120120
private _stackFrames = new Map<number, xdebug.StackFrame>()
121121

122-
/** A map from XDebug connections to their current status */
122+
/** A map from Xdebug connections to their current status */
123123
private _statuses = new Map<xdebug.Connection, xdebug.StatusResponse>()
124124

125125
/** A counter for unique context, property and eval result properties (as these are all requested by a VariableRequest from VS Code) */
126126
private _variableIdCounter = 1
127127

128-
/** A map from unique VS Code variable IDs to XDebug statuses for virtual error stack frames */
128+
/** A map from unique VS Code variable IDs to Xdebug statuses for virtual error stack frames */
129129
private _errorStackFrames = new Map<number, xdebug.StatusResponse>()
130130

131-
/** A map from unique VS Code variable IDs to XDebug statuses for virtual error scopes */
131+
/** A map from unique VS Code variable IDs to Xdebug statuses for virtual error scopes */
132132
private _errorScopes = new Map<number, xdebug.StatusResponse>()
133133

134-
/** A map from unique VS Code variable IDs to an XDebug contexts */
134+
/** A map from unique VS Code variable IDs to an Xdebug contexts */
135135
private _contexts = new Map<number, xdebug.Context>()
136136

137-
/** A map from unique VS Code variable IDs to a XDebug properties */
137+
/** A map from unique VS Code variable IDs to a Xdebug properties */
138138
private _properties = new Map<number, xdebug.Property>()
139139

140-
/** A map from unique VS Code variable IDs to XDebug eval result properties, because property children returned from eval commands are always inlined */
140+
/** A map from unique VS Code variable IDs to Xdebug eval result properties, because property children returned from eval commands are always inlined */
141141
private _evalResultProperties = new Map<number, xdebug.EvalResultProperty>()
142142

143143
/** A flag to indicate that the adapter has already processed the stopOnEntry step request */
@@ -250,13 +250,13 @@ class PhpDebugSession extends vscode.DebugSession {
250250
this._phpProcess = script
251251
}
252252
}
253-
/** sets up a TCP server to listen for XDebug connections */
253+
/** sets up a TCP server to listen for Xdebug connections */
254254
const createServer = () =>
255255
new Promise<void>((resolve, reject) => {
256256
const server = (this._server = net.createServer())
257257
server.on('connection', async (socket: net.Socket) => {
258258
try {
259-
// new XDebug connection
259+
// new Xdebug connection
260260
const connection = new xdebug.Connection(socket)
261261
if (args.log) {
262262
this.sendEvent(new vscode.OutputEvent('new connection ' + connection.id + '\n'), true)
@@ -456,7 +456,7 @@ class PhpDebugSession extends vscode.DebugSession {
456456
vscodeBreakpoints = args.breakpoints!.map(breakpoint => ({ verified: false, line: breakpoint.line }))
457457
} else {
458458
vscodeBreakpoints = []
459-
// create XDebug breakpoints from the arguments
459+
// create Xdebug breakpoints from the arguments
460460
xdebugBreakpoints = args.breakpoints!.map(breakpoint => {
461461
if (breakpoint.condition) {
462462
return new xdebug.ConditionalBreakpoint(breakpoint.condition, fileUri, breakpoint.line)
@@ -651,7 +651,7 @@ class PhpDebugSession extends vscode.DebugSession {
651651
protected threadsRequest(response: VSCodeDebugProtocol.ThreadsResponse): void {
652652
// PHP doesn't have threads, but it may have multiple requests in parallel.
653653
// Think about a website that makes multiple, parallel AJAX requests to your PHP backend.
654-
// XDebug opens a new socket connection for each of them, we tell VS Code that these are our threads.
654+
// Xdebug opens a new socket connection for each of them, we tell VS Code that these are our threads.
655655
const connections = Array.from(this._connections.values())
656656
response.body = {
657657
threads: connections.map(
@@ -699,7 +699,7 @@ class PhpDebugSession extends vscode.DebugSession {
699699
// for eval code, we add a "<?php" line at the beginning to get syntax highlighting (see sourceRequest)
700700
line++
701701
} else {
702-
// XDebug paths are URIs, VS Code file paths
702+
// Xdebug paths are URIs, VS Code file paths
703703
const filePath = convertDebuggerPathToClient(urlObject, this._args.pathMappings)
704704
// "Name" of the source and the actual file path
705705
source = { name: path.basename(filePath), path: filePath }
@@ -725,7 +725,7 @@ class PhpDebugSession extends vscode.DebugSession {
725725
// for eval code, we add a "<?php" line at the beginning to get syntax highlighting (see sourceRequest)
726726
line++
727727
} else {
728-
// XDebug paths are URIs, VS Code file paths
728+
// Xdebug paths are URIs, VS Code file paths
729729
const filePath = convertDebuggerPathToClient(urlObject, this._args.pathMappings)
730730
// "Name" of the source and the actual file path
731731
source = { name: path.basename(filePath), path: filePath }
@@ -734,7 +734,7 @@ class PhpDebugSession extends vscode.DebugSession {
734734
const stackFrameId = this._stackFrameIdCounter++
735735
// save the connection this stackframe belongs to and the level of the stackframe under the stacktrace id
736736
this._stackFrames.set(stackFrameId, stackFrame)
737-
// prepare response for VS Code (column is always 1 since XDebug doesn't tell us the column)
737+
// prepare response for VS Code (column is always 1 since Xdebug doesn't tell us the column)
738738
return { id: stackFrameId, name: stackFrame.name, source, line, column: 1 }
739739
}
740740
),
@@ -791,7 +791,7 @@ class PhpDebugSession extends vscode.DebugSession {
791791
const contexts = await stackFrame.getContexts()
792792
scopes = contexts.map(context => {
793793
const variableId = this._variableIdCounter++
794-
// remember that this new variable ID is assigned to a SCOPE (in XDebug "context"), not a variable (in XDebug "property"),
794+
// remember that this new variable ID is assigned to a SCOPE (in Xdebug "context"), not a variable (in Xdebug "property"),
795795
// so when VS Code does a variablesRequest with that ID we do a context_get and not a property_get
796796
this._contexts.set(variableId, context)
797797
// send VS Code the variable ID as identifier
@@ -1002,7 +1002,7 @@ class PhpDebugSession extends vscode.DebugSession {
10021002
}
10031003

10041004
protected pauseRequest(response: VSCodeDebugProtocol.PauseResponse, args: VSCodeDebugProtocol.PauseArguments) {
1005-
this.sendErrorResponse(response, new Error('Pausing the execution is not supported by XDebug'))
1005+
this.sendErrorResponse(response, new Error('Pausing the execution is not supported by Xdebug'))
10061006
}
10071007

10081008
protected async disconnectRequest(

src/test/adapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ describe('PHP Debug Adapter', () => {
389389
const scopes = (await client.scopesRequest({ frameId: stackFrame.id })).body.scopes
390390
localScope = scopes.find(scope => scope.name === 'Locals')
391391
superglobalsScope = scopes.find(scope => scope.name === 'Superglobals')
392-
constantsScope = scopes.find(scope => scope.name === 'User defined constants') // XDebug >2.3 only
392+
constantsScope = scopes.find(scope => scope.name === 'User defined constants') // Xdebug >2.3 only
393393
})
394394

395395
it('should report scopes correctly', () => {

0 commit comments

Comments
 (0)