aboutsummaryrefslogtreecommitdiffstats
path: root/python/vhdl_langserver/lsptools.py
diff options
context:
space:
mode:
authortgingold <tgingold@users.noreply.github.com>2020-12-29 17:19:09 +0100
committerGitHub <noreply@github.com>2020-12-29 17:19:09 +0100
commit7ca54117b8f757396ba5ef04c83ff1228ca94384 (patch)
treecc5f7f4166cc0570bda5cf2047d3ef7abbc36e37 /python/vhdl_langserver/lsptools.py
parent340fc792bba2ffdb4f930bc427a39ea3a1b659b2 (diff)
parent50adcf884c3cfa4e33ca45769295f163baa63a3e (diff)
downloadghdl-7ca54117b8f757396ba5ef04c83ff1228ca94384.tar.gz
ghdl-7ca54117b8f757396ba5ef04c83ff1228ca94384.tar.bz2
ghdl-7ca54117b8f757396ba5ef04c83ff1228ca94384.zip
Merge pull request #1556 from Paebbels/paebbels/pyGHDL
Cleanup and Restructuring of pyGHDL
Diffstat (limited to 'python/vhdl_langserver/lsptools.py')
-rw-r--r--python/vhdl_langserver/lsptools.py41
1 files changed, 0 insertions, 41 deletions
diff --git a/python/vhdl_langserver/lsptools.py b/python/vhdl_langserver/lsptools.py
deleted file mode 100644
index 648f0a8c0..000000000
--- a/python/vhdl_langserver/lsptools.py
+++ /dev/null
@@ -1,41 +0,0 @@
-import sys
-import argparse
-import json
-from . import lsp
-
-
-def lsp2json():
- "Utility that transforms lsp log file to a JSON list"
- conn = lsp.LSPConn(sys.stdin.buffer, sys.stdout.buffer)
- ls = lsp.LanguageProtocolServer(None, conn)
- res = []
- while True:
- req = ls.read_request()
- if req is None:
- break
- res.append(json.loads(req))
- print(json.dumps(res, indent=2))
-
-
-def json2lsp():
- "Utility that transform a JSON list to an lsp file"
- res = json.load(sys.stdin)
- conn = lsp.LSPConn(sys.stdin.buffer, sys.stdout.buffer)
- ls = lsp.LanguageProtocolServer(None, conn)
- for req in res:
- ls.write_output(req)
-
-
-def main():
- parser = argparse.ArgumentParser()
- subparsers = parser.add_subparsers(help="sub-command help")
- parser_l2j = subparsers.add_parser("lsp2json", help="convert lsp dump to JSON")
- parser_l2j.set_defaults(func=lsp2json)
- parser_j2l = subparsers.add_parser("json2lsp", help="convert JSON to lsp dump")
- parser_j2l.set_defaults(func=json2lsp)
- args = parser.parse_args()
- args.func()
-
-
-if __name__ == "__main__":
- main()