~tomleb/harepls

f093545174e1c789b004da43d2f1597c163fbb9c — Tom Lebreux 5 months ago b99fea7
Return invalid request when server is already initialized
1 files changed, 7 insertions(+), 3 deletions(-)

M lsp/server.ha
M lsp/server.ha => lsp/server.ha +7 -3
@@ 185,9 185,13 @@ fn _serve_request(s: *server, req: jsonrpc::request) (jsonrpc::response | unmars
	};

	if (req.method == "initialize") {
		// We should only receive the initialize request once
		// TODO: What do here?
		void;
		// Does not seem to be specified in the spec so let's just
		// return an error
		return jsonrpc::error {
			code = jsonrpc::INVALID_REQUEST,
			message = "Server is already initialized",
			data = void,
		};
	};

	if (req.method == "textDocument/definition") {