From c61632d625d340db4dcb4cc57c7d1d38fac5ccb8 Mon Sep 17 00:00:00 2001 From: Mitsuo Heijo Date: Tue, 24 Dec 2019 23:38:50 +0900 Subject: feature: support metals, fortls - fix: imporve npm and pip install - proposal: add simple test script --- test/send.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 test/send.py (limited to 'test/send.py') diff --git a/test/send.py b/test/send.py new file mode 100755 index 0000000..78b89aa --- /dev/null +++ b/test/send.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python3 +import json +import sys + + +def send(message: dict): + raw = json.dumps(message) + message = "Content-Length: " + str(len(raw)) + "\r\n\r\n" + raw + sys.stdout.write(message) + + +initialize = { + "jsonrpc": "2.0", + "id": 1, + "method": "initialize", + "params": {"processId": None, "rootUri": None, "capabilities": {}}, +} +send(initialize) + +initialized = { + "jsonrpc": "2.0", + "id": 2, + "method": "initialized", + "params": {}, +} +send(initialized) + +shutdown = { + "jsonrpc": "2.0", + "id": 3, + "method": "shutdown", + "params": {}, +} +send(shutdown) + +_exit = { + "jsonrpc": "2.0", + "id": 4, + "method": "exit", + "params": {}, +} +send(_exit) -- cgit v1.2.3-54-g00ecf