diff --git a/lib/jsonrpc2.js b/lib/jsonrpc2.js index d1d2f8e..5dca4cb 100644 --- a/lib/jsonrpc2.js +++ b/lib/jsonrpc2.js @@ -69,12 +69,15 @@ function extract(message, callback) { try { var result = callback(data.method, params, id); - return { - jsonrpc: "2.0", - result: result === undefined ? null : result, - id: id - }; + if (result !== false) { + return { + jsonrpc: "2.0", + result: result === undefined ? null : result, + id: id + }; + } + return result; } catch (e) { return { jsonrpc: "2.0", diff --git a/lib/stdio-server.js b/lib/stdio-server.js index 2f05d90..6f223bc 100644 --- a/lib/stdio-server.js +++ b/lib/stdio-server.js @@ -16,14 +16,17 @@ function StdioServer() { }; this.send = function (message) { + if (!message) return; + if (typeof message === "object") { try { var _serialized = JSON.stringify(message); message = _serialized; - } catch (e) { /* ignore */ }; + } catch (e) { /* ignore */ } } WScript.StdOut.WriteLine(message); + WScript.StdErr.WriteLine(message); }; this.listen = function () { diff --git a/mcploader.js b/mcploader.js index 13e5055..2ee76da 100644 --- a/mcploader.js +++ b/mcploader.js @@ -31,6 +31,11 @@ function main(args) { }; } + if (method === "notifications/initialized") { + // DO NOT return anything + return false; + } + if (method == "tools/list") { return { "tools": [