You've already forked ada_language_server
mirror of
https://github.com/AdaCore/ada_language_server.git
synced 2026-02-12 12:45:50 -08:00
26 lines
650 B
Python
Executable File
26 lines
650 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
""" Development utility to replay the most recent trace file, and output it
|
|
as protocol strings. This assumes that the trace file is in ~/.als/in.txt
|
|
|
|
To use this, do
|
|
|
|
replay.py > log
|
|
|
|
then you can replay at will with
|
|
|
|
ada_language_server < log
|
|
"""
|
|
|
|
import os
|
|
from json_transformations import python_to_protocol_string, traces_to_test
|
|
|
|
als_dir = os.path.join(os.path.expanduser('~'), '.als')
|
|
inout_file = os.path.join(als_dir, 'inout.txt')
|
|
test = traces_to_test(inout_file, None, True)
|
|
result = ""
|
|
for x in test:
|
|
if "send" in x:
|
|
result += python_to_protocol_string([x["send"]["request"]])
|
|
print(result + "\r")
|