@@ -30,20 +30,24 @@ export function activate(context: vscode.ExtensionContext) {
3030 javaExecutablePath = findJava ( ) ;
3131 startClient ( ) ;
3232
33- vscode . workspace . onDidChangeConfiguration ( onDidChangeConfiguration , null , savedContext . subscriptions ) ;
34- vscode . workspace . onDidChangeTextDocument ( onDidChangeTextDocument , null , savedContext . subscriptions ) ;
35- vscode . window . onDidChangeActiveTextEditor ( onDidChangeActiveTextEditor , null , savedContext . subscriptions ) ;
36- vscode . commands . registerCommand ( "emmy.restartServer" , restartServer ) ;
37- vscode . commands . registerCommand ( "emmy.showReferences" , showReferences ) ;
33+ savedContext . subscriptions . push ( vscode . workspace . onDidChangeConfiguration ( onDidChangeConfiguration , null , savedContext . subscriptions ) ) ;
34+ savedContext . subscriptions . push ( vscode . workspace . onDidChangeTextDocument ( onDidChangeTextDocument , null , savedContext . subscriptions ) ) ;
35+ savedContext . subscriptions . push ( vscode . window . onDidChangeActiveTextEditor ( onDidChangeActiveTextEditor , null , savedContext . subscriptions ) ) ;
36+ savedContext . subscriptions . push ( vscode . commands . registerCommand ( "emmy.restartServer" , restartServer ) ) ;
37+ savedContext . subscriptions . push ( vscode . commands . registerCommand ( "emmy.showReferences" , showReferences ) ) ;
3838
39- vscode . languages . registerDocumentFormattingEditProvider ( { scheme : "file" , language : LANGUAGE_ID } , {
39+ savedContext . subscriptions . push ( vscode . languages . registerDocumentFormattingEditProvider ( { scheme : "file" , language : LANGUAGE_ID } , {
4040 provideDocumentFormattingEdits ( document , position , token ) : vscode . ProviderResult < vscode . TextEdit [ ] > {
4141 return [ new vscode . TextEdit ( new vscode . Range ( 0 , 0 , document . lineCount , 0 ) , formatText ( document . getText ( ) ) ) ] ;
4242 }
4343 }
44- ) ;
45- vscode . languages . setLanguageConfiguration ( "lua" , new LuaLanguageConfiguration ( ) ) ;
44+ ) ) ;
45+ savedContext . subscriptions . push ( vscode . languages . setLanguageConfiguration ( "lua" , new LuaLanguageConfiguration ( ) ) ) ;
4646
47+ registerDebuggers ( ) ;
48+ }
49+
50+ function registerDebuggers ( ) {
4751 const attProvider = new AttachDebuggerProvider ( ) ;
4852 savedContext . subscriptions . push ( vscode . debug . registerDebugConfigurationProvider ( "emmylua_attach" , attProvider ) ) ;
4953 savedContext . subscriptions . push ( attProvider ) ;
@@ -54,9 +58,9 @@ export function activate(context: vscode.ExtensionContext) {
5458 savedContext . subscriptions . push ( vscode . debug . registerDebugConfigurationProvider ( "emmylua_remote" , mobProvider ) ) ;
5559 savedContext . subscriptions . push ( vscode . debug . registerDebugConfigurationProvider ( "emmylua_remote_launch" , mobProvider ) ) ;
5660 savedContext . subscriptions . push ( mobProvider ) ;
57- vscode . debug . onDidReceiveDebugSessionCustomEvent ( e => {
61+ savedContext . subscriptions . push ( vscode . debug . onDidReceiveDebugSessionCustomEvent ( e => {
5862 console . log ( e . body ) ;
59- } ) ;
63+ } ) ) ;
6064}
6165
6266function onDidChangeTextDocument ( event : vscode . TextDocumentChangeEvent ) {
0 commit comments