Skip to content

Commit 1781fa3

Browse files
committed
Add editorconfig, fix stylistic issues
1 parent baec811 commit 1781fa3

File tree

6 files changed

+68
-83
lines changed

6 files changed

+68
-83
lines changed

.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
[*]
3+
insert_spaces = true
4+
indent_size = 4
5+
6+
[*.json]
7+
indent_size = 2

.vscode/launch.json

Lines changed: 26 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,28 @@
11
{
2-
"version": "0.2.0",
3-
"configurations": [
4-
{
5-
"name": "Debug adapter",
6-
"type": "node",
7-
"request": "launch",
8-
"runtimeArgs": [
9-
"--harmony"
10-
],
11-
"program": "${workspaceRoot}/src/phpDebug.ts",
12-
"stopOnEntry": false,
13-
"args": [
14-
"--server=4711"
15-
],
16-
"env": {
17-
"NODE_ENV": "development"
18-
},
19-
"sourceMaps": true,
20-
"outDir": "${workspaceRoot}/out"
21-
},
22-
{
23-
"name": "Launch Extension",
24-
"type": "extensionHost",
25-
"request": "launch",
26-
"runtimeExecutable": "${execPath}",
27-
"args": [
28-
"--extensionDevelopmentPath=${workspaceRoot}"
29-
],
30-
"sourceMaps": true,
31-
"outDir": "${workspaceRoot}/out"
32-
},
33-
{
34-
"name": "Run Tests",
35-
"type": "node",
36-
"request": "launch",
37-
"program": "${workspaceRoot}node_modules/mocha/bin/_mocha",
38-
"args": [
39-
"./out/tests",
40-
"--timeout",
41-
"999999",
42-
"--colors"
43-
],
44-
"sourceMaps": true,
45-
"outDir": "${workspaceRoot}/out"
46-
}
47-
]
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Debug adapter",
6+
"type": "node",
7+
"request": "launch",
8+
"runtimeArgs": ["--harmony"],
9+
"program": "${workspaceRoot}/src/phpDebug.ts",
10+
"stopOnEntry": false,
11+
"args": ["--server=4711"],
12+
"env": {
13+
"NODE_ENV": "development"
14+
},
15+
"sourceMaps": true,
16+
"outDir": "${workspaceRoot}/out"
17+
},
18+
{
19+
"name": "Launch Extension",
20+
"type": "extensionHost",
21+
"request": "launch",
22+
"runtimeExecutable": "${execPath}",
23+
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
24+
"sourceMaps": true,
25+
"outDir": "${workspaceRoot}/out"
26+
}
27+
]
4828
}

.vscode/tasks.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"version": "0.1.0",
3-
"command": "npm",
4-
"isShellCommand": true,
5-
"args": ["run"],
6-
"showOutput": "silent",
7-
"tasks": [
8-
{
9-
"taskName": "watch",
10-
"isWatching": true,
11-
"problemMatcher": "$tsc-watch"
12-
},
13-
{
14-
"taskName": "compile",
15-
"isBuildCommand": true,
16-
"problemMatcher": "$tsc"
17-
}
18-
]
2+
"version": "0.1.0",
3+
"command": "npm",
4+
"isShellCommand": true,
5+
"args": ["run"],
6+
"showOutput": "silent",
7+
"tasks": [
8+
{
9+
"taskName": "watch",
10+
"isWatching": true,
11+
"problemMatcher": "$tsc-watch"
12+
},
13+
{
14+
"taskName": "compile",
15+
"isBuildCommand": true,
16+
"problemMatcher": "$tsc"
17+
}
18+
]
1919
}

src/phpDebug.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ class PhpDebugSession extends vscode.DebugSession {
125125
super(debuggerLinesStartAt1, isServer);
126126
}
127127

128-
protected initializeRequest(response: VSCodeDebugProtocol.InitializeResponse, args: VSCodeDebugProtocol.InitializeRequestArguments): void {
129-
response.body.supportsConfigurationDoneRequest = true;
128+
protected initializeRequest(response: VSCodeDebugProtocol.InitializeResponse, args: VSCodeDebugProtocol.InitializeRequestArguments): void {
129+
response.body.supportsConfigurationDoneRequest = true;
130130
response.body.supportsEvaluateForHovers = true;
131-
this.sendResponse(response);
132-
}
131+
this.sendResponse(response);
132+
}
133133

134134
protected attachRequest(response: VSCodeDebugProtocol.AttachResponse, args: VSCodeDebugProtocol.AttachRequestArguments) {
135135
this.sendErrorResponse(response, 0, 'Attach requests are not supported');
@@ -288,7 +288,7 @@ class PhpDebugSession extends vscode.DebugSession {
288288
this.sendEvent(new vscode.OutputEvent(log));
289289
}
290290
super.sendEvent(event);
291-
}
291+
}
292292

293293
public sendResponse(response: VSCodeDebugProtocol.Response): void {
294294
const log = `<- ${response.command}Response\n${util.inspect(response, {depth: null})}\n\n`;
@@ -567,7 +567,7 @@ class PhpDebugSession extends vscode.DebugSession {
567567
this.sendResponse(response);
568568
}
569569

570-
protected stepInRequest(response: VSCodeDebugProtocol.StepInResponse, args: VSCodeDebugProtocol.StepInArguments) : void {
570+
protected stepInRequest(response: VSCodeDebugProtocol.StepInResponse, args: VSCodeDebugProtocol.StepInArguments) : void {
571571
if (!args.threadId) {
572572
this.sendErrorResponse(response, 0, 'No active connection');
573573
return;
@@ -576,10 +576,10 @@ class PhpDebugSession extends vscode.DebugSession {
576576
connection.sendStepIntoCommand()
577577
.then(response => this._checkStatus(response))
578578
.catch(error => this.sendErrorResponse(response, error.code, error.message));
579-
this.sendResponse(response);
580-
}
579+
this.sendResponse(response);
580+
}
581581

582-
protected stepOutRequest(response: VSCodeDebugProtocol.StepOutResponse, args: VSCodeDebugProtocol.StepOutArguments) : void {
582+
protected stepOutRequest(response: VSCodeDebugProtocol.StepOutResponse, args: VSCodeDebugProtocol.StepOutArguments) : void {
583583
if (!args.threadId) {
584584
this.sendErrorResponse(response, 0, 'No active connection');
585585
return;
@@ -588,12 +588,12 @@ class PhpDebugSession extends vscode.DebugSession {
588588
connection.sendStepOutCommand()
589589
.then(response => this._checkStatus(response))
590590
.catch(error => this.sendErrorResponse(response, error.code, error.message));
591-
this.sendResponse(response);
592-
}
591+
this.sendResponse(response);
592+
}
593593

594-
protected pauseRequest(response: VSCodeDebugProtocol.PauseResponse, args: VSCodeDebugProtocol.PauseArguments) : void {
595-
this.sendErrorResponse(response, 0, 'Pausing the execution is not supported by XDebug');
596-
}
594+
protected pauseRequest(response: VSCodeDebugProtocol.PauseResponse, args: VSCodeDebugProtocol.PauseArguments) : void {
595+
this.sendErrorResponse(response, 0, 'Pausing the execution is not supported by XDebug');
596+
}
597597

598598
protected disconnectRequest(response: VSCodeDebugProtocol.DisconnectResponse, args: VSCodeDebugProtocol.DisconnectArguments): void {
599599
Promise.all(Array.from(this._connections).map(([id, connection]) =>
@@ -614,7 +614,7 @@ class PhpDebugSession extends vscode.DebugSession {
614614
}).catch(error => {
615615
this.sendErrorResponse(response, error.code, error.message)
616616
});
617-
}
617+
}
618618

619619
protected evaluateRequest(response: VSCodeDebugProtocol.EvaluateResponse, args: VSCodeDebugProtocol.EvaluateArguments): void {
620620
const connection = this._stackFrames.get(args.frameId).connection;

src/xdebugConnection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class StatusResponse extends Response {
9797
this.exception = {
9898
name: messageNode.getAttribute('exception'),
9999
message: messageNode.textContent
100-
}
100+
};
101101
}
102102
if (messageNode.hasAttribute('filename')) {
103103
this.fileUri = messageNode.getAttribute('filename');

testproject/index.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
$nullValue = null;
1111
$variableThatsNotSet;
1212
$aLargeArray = array_fill(0, 100, 'test');
13-
13+
1414
class TestParentClass {
1515
public static $aStaticProperty = 1234;
1616
}
17-
17+
1818
class TestClass extends TestParentClass {
1919
public static $aStaticProperty = 5678;
2020
public $aProperty;
@@ -73,5 +73,3 @@ function triggerWarning() {
7373
throwDerivedException();
7474

7575
throwCaughtException();
76-
77-

0 commit comments

Comments
 (0)