Skip to content

Commit

Permalink
Fixes #298 - MessageBox not implemented
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <[email protected]>
  • Loading branch information
robstryker committed Apr 1, 2024
1 parent 4138ad9 commit eed6ca2
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/rsp/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,28 @@ export async function initClient(serverInfo: ServerInfo): Promise<RSPClient> {
});
});
});
client.getIncomingHandler().onMessageBox(event => {
return new Promise<string>((resolve, reject) => {
if( event.severity === 1 ) {
// info
vscode.window.showInformationMessage(event.message);
} else if( event.severity === 2 ) {
// warning
vscode.window.showWarningMessage(event.message);
} else if( event.severity === 4 ) {
// error
vscode.window.showErrorMessage(event.message);
}
})
});

client.getOutgoingHandler().registerClientCapabilities(
{ map: { 'protocol.version': PROTOCOL_VERSION, 'prompt.string': 'true' } });
client.getOutgoingHandler().registerClientCapabilities({
map: {
'protocol.version': PROTOCOL_VERSION,
'prompt.string': 'true',
'messagebox': 'true',
}
});
JobProgress.create(client);

return client;
Expand Down

0 comments on commit eed6ca2

Please sign in to comment.