@@ -60,6 +60,18 @@ let codeActionsFromDiagnostics: codeActions.filesCodeActions = {};
60
60
// will be properly defined later depending on the mode (stdio/node-rpc)
61
61
let send : ( msg : p . Message ) => void = ( _ ) => { } ;
62
62
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
+
63
75
let findRescriptBinary = async ( projectRootPath : p . DocumentUri | null ) : Promise < string | null > => {
64
76
if ( config . extensionConfiguration . binaryPath != null &&
65
77
fs . existsSync ( path . join ( config . extensionConfiguration . binaryPath , "rescript" ) ) ) {
@@ -1040,6 +1052,7 @@ async function onMessage(msg: p.Message) {
1040
1052
process . exit ( 1 ) ;
1041
1053
}
1042
1054
} else if ( msg . method === InitializedNotification . method ) {
1055
+ mediLog ( "Got Client initialized" ) ;
1043
1056
/*
1044
1057
The initialized notification is sent from the client to the server after the client received the result of the initialize request
1045
1058
but before the client is sending any other request or notification to the server.
@@ -1084,6 +1097,9 @@ async function onMessage(msg: p.Message) {
1084
1097
send ( req ) ;
1085
1098
} else if ( msg . method === DidChangeWatchedFilesNotification . method ) {
1086
1099
const params = msg . params as p . DidChangeWatchedFilesParams ;
1100
+ params . changes . forEach ( ( change ) => {
1101
+ mediLog ( `File change: ${ change . uri } ` ) ;
1102
+ } ) ;
1087
1103
await onWorkspaceDidChangeWatchedFiles ( params ) ;
1088
1104
} else if ( msg . method === DidOpenTextDocumentNotification . method ) {
1089
1105
let params = msg . params as p . DidOpenTextDocumentParams ;
@@ -1133,6 +1149,7 @@ async function onMessage(msg: p.Message) {
1133
1149
for ( const workspaceFolder of initParams . workspaceFolders || [ ] ) {
1134
1150
const workspaceRootPath = fileURLToPath ( workspaceFolder . uri ) ;
1135
1151
workspaceFolders . add ( workspaceRootPath ) ;
1152
+ mediLog ( `Add workspace folder: ${ workspaceRootPath } ` ) ;
1136
1153
}
1137
1154
let initialConfiguration = initParams . initializationOptions
1138
1155
?. extensionConfiguration as extensionConfiguration | undefined ;
0 commit comments