I am trying to send either single instances of an object, or ideally an array or hashmap containing many instances of an object, from a java language server to a typescript vscode extension. Previously I was able to return a string completable future promise and unpack that back into a string as follows: The extension requests the server:
let stringPromise = client.sendRequest("GetString");
At the end of the command on the server side this is returned:
return CompletableFuture.completedFuture(string);
On the extension typescript side the string is extracted into the extensionString
variable
which is a normal string variable and can be printed etc.
stringPromise.then((val) => extensionString = ("" + val));
Is it possible to do similar (through this method or another that would have the same end result) but with an object where at the end result I could maybe have the object accessible on the typescript side in a JSON format etc? And even better if it can be an array of such objects?
In summary - how to send an array or hashmap of objects from language server/java project on vscode to vscode typescript extension project?
An example of the data might be:
{IntegerID:Object}
hashmap where each object has multiple pieces of data such as text, name, date, etc.