@@ -60,6 +60,18 @@ let codeActionsFromDiagnostics: codeActions.filesCodeActions = {};
6060// will be properly defined later depending on the mode (stdio/node-rpc)
6161let send : ( msg : p . Message ) => void = ( _ ) => { } ;
6262
63+ let mediLog = ( message : string ) => {
64+ const notificationMessage : p . NotificationMessage = {
65+ method : p . LogMessageNotification . method ,
66+ jsonrpc : c . jsonrpcVersion ,
67+ params : {
68+ type : p . MessageType . Info ,
69+ message,
70+ } ,
71+ } ;
72+ send ( notificationMessage ) ;
73+ } ;
74+
6375let findRescriptBinary = async ( projectRootPath : p . DocumentUri | null ) : Promise < string | null > => {
6476 if ( config . extensionConfiguration . binaryPath != null &&
6577 fs . existsSync ( path . join ( config . extensionConfiguration . binaryPath , "rescript" ) ) ) {
@@ -1040,6 +1052,7 @@ async function onMessage(msg: p.Message) {
10401052 process . exit ( 1 ) ;
10411053 }
10421054 } else if ( msg . method === InitializedNotification . method ) {
1055+ mediLog ( "Got Client initialized" ) ;
10431056 /*
10441057 The initialized notification is sent from the client to the server after the client received the result of the initialize request
10451058 but before the client is sending any other request or notification to the server.
@@ -1084,6 +1097,9 @@ async function onMessage(msg: p.Message) {
10841097 send ( req ) ;
10851098 } else if ( msg . method === DidChangeWatchedFilesNotification . method ) {
10861099 const params = msg . params as p . DidChangeWatchedFilesParams ;
1100+ params . changes . forEach ( ( change ) => {
1101+ mediLog ( `File change: ${ change . uri } ` ) ;
1102+ } ) ;
10871103 await onWorkspaceDidChangeWatchedFiles ( params ) ;
10881104 } else if ( msg . method === DidOpenTextDocumentNotification . method ) {
10891105 let params = msg . params as p . DidOpenTextDocumentParams ;
@@ -1133,6 +1149,7 @@ async function onMessage(msg: p.Message) {
11331149 for ( const workspaceFolder of initParams . workspaceFolders || [ ] ) {
11341150 const workspaceRootPath = fileURLToPath ( workspaceFolder . uri ) ;
11351151 workspaceFolders . add ( workspaceRootPath ) ;
1152+ mediLog ( `Add workspace folder: ${ workspaceRootPath } ` ) ;
11361153 }
11371154 let initialConfiguration = initParams . initializationOptions
11381155 ?. extensionConfiguration as extensionConfiguration | undefined ;
0 commit comments