-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest.py
More file actions
39 lines (25 loc) · 680 Bytes
/
test.py
File metadata and controls
39 lines (25 loc) · 680 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#
# Run with: python3 test.py /path/to/clangd
#
import ls_interact as ls
import sys
import os
def interact(json_rpc):
here = os.getcwd()
paths = [here + '/test.cpp']
for p in paths:
json_rpc.notify(ls.DidOpenTextDocument(p))
for p in paths:
json_rpc.wait_for(ls.JsonRpc.JsonRpcPendingMethod(
'textDocument/publishDiagnostics'))
r = json_rpc.request(ls.Hover(paths[0], 11, 9))
r = json_rpc.wait_for(r)
for i in range(5):
print(file=sys.stderr)
print(r['contents']['value'])
for i in range(5):
print(file=sys.stderr)
def main():
ls.run(interact)
if __name__ == '__main__':
main()