1
1
import * as vscode from 'vscode'
2
- import { PhpDebugSession } from './phpDebug'
2
+ import { PhpDebugSession } from './phpDebug'
3
3
4
4
export function activate ( context : vscode . ExtensionContext ) {
5
5
console . log ( 'activate' )
6
6
7
- context . subscriptions . push ( vscode . debug . onDidStartDebugSession ( session => {
8
- console . log ( 'onDidStartDebugSession' , session )
9
- //session.customRequest('test1', { test2: "test3" })
10
- } ) )
11
- context . subscriptions . push ( vscode . debug . onDidTerminateDebugSession ( session => {
12
- console . log ( 'onDidTerminateDebugSession' , session )
13
- } ) )
7
+ context . subscriptions . push (
8
+ vscode . debug . onDidStartDebugSession ( session => {
9
+ console . log ( 'onDidStartDebugSession' , session )
10
+ //session.customRequest('test1', { test2: "test3" })
11
+ } )
12
+ )
13
+ context . subscriptions . push (
14
+ vscode . debug . onDidTerminateDebugSession ( session => {
15
+ console . log ( 'onDidTerminateDebugSession' , session )
16
+ } )
17
+ )
14
18
15
- context . subscriptions . push ( vscode . debug . onDidReceiveDebugSessionCustomEvent ( event => {
16
- console . log ( 'onDidReceiveDebugSessionCustomEvent' , event )
17
- if ( event . event === 'newDbgpConnection' ) {
18
- const config : vscode . DebugConfiguration = {
19
- ...event . session . configuration
19
+ context . subscriptions . push (
20
+ vscode . debug . onDidReceiveDebugSessionCustomEvent ( event => {
21
+ console . log ( 'onDidReceiveDebugSessionCustomEvent' , event )
22
+ if ( event . event === 'newDbgpConnection' ) {
23
+ const config : vscode . DebugConfiguration = {
24
+ ...event . session . configuration ,
25
+ }
26
+ config . request = 'attach'
27
+ config . name = 'DBGp connection ' + event . body . connId
28
+ config . connId = event . body . connId
29
+ vscode . debug . startDebugging ( undefined , config , event . session )
20
30
}
21
- config . request = 'attach'
22
- config . name = 'DBGp connection ' + event . body . connId
23
- config . connId = event . body . connId
24
- vscode . debug . startDebugging ( undefined , config , event . session )
25
- }
26
- } ) )
31
+ } )
32
+ )
27
33
28
34
const factory = new InlineDebugAdapterFactory ( )
29
- context . subscriptions . push ( vscode . debug . registerDebugAdapterDescriptorFactory ( 'php' , factory ) ) ;
30
- if ( 'dispose' in factory ) {
31
- context . subscriptions . push ( factory ) ;
32
- }
35
+ context . subscriptions . push ( vscode . debug . registerDebugAdapterDescriptorFactory ( 'php' , factory ) )
36
+ if ( 'dispose' in factory ) {
37
+ context . subscriptions . push ( factory )
38
+ }
33
39
}
34
40
35
41
export function deactivate ( ) {
36
42
console . log ( 'deactivate' )
37
43
}
38
44
39
45
class InlineDebugAdapterFactory implements vscode . DebugAdapterDescriptorFactory {
40
-
41
- createDebugAdapterDescriptor ( _session : vscode . DebugSession ) : vscode . ProviderResult < vscode . DebugAdapterDescriptor > {
42
- // since DebugAdapterInlineImplementation is proposed API, a cast to <any> is required for now
43
- return < any > new vscode . DebugAdapterInlineImplementation ( new PhpDebugSession ( ) ) ;
44
- }
45
- }
46
+ createDebugAdapterDescriptor ( _session : vscode . DebugSession ) : vscode . ProviderResult < vscode . DebugAdapterDescriptor > {
47
+ // since DebugAdapterInlineImplementation is proposed API, a cast to <any> is required for now
48
+ return < any > new vscode . DebugAdapterInlineImplementation ( new PhpDebugSession ( ) )
49
+ }
50
+ }
0 commit comments