Skip to content

Commit 773732b

Browse files
authored
Merge pull request #254 from chrisbra/lspdebug
debug: better debugging of failing lsp test
2 parents 3c403cc + ed6a6a1 commit 773732b

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

patch/lspdebug.patch

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
2+
index 6ad9dc0e1..04633bfdb 100644
3+
--- a/src/testdir/test_channel.vim
4+
+++ b/src/testdir/test_channel.vim
5+
@@ -2466,7 +2466,7 @@ func LspOtCb(chan, msg)
6+
endfunc
7+
8+
func LspTests(port)
9+
- " call ch_logfile('Xlsprpc.log', 'w')
10+
+ call ch_logfile('Xlsprpc.log', 'w')
11+
let ch = ch_open(s:localhost .. a:port, #{mode: 'lsp', callback: 'LspCb'})
12+
if ch_status(ch) == "fail"
13+
call assert_report("Can't open the lsp channel")
14+
@@ -2659,11 +2659,20 @@ func LspTests(port)
15+
call assert_fails('call ch_evalexpr(ch, [1, 2, 3])', 'E1206:')
16+
call assert_fails('call ch_sendexpr(ch, "abc")', 'E1206:')
17+
call assert_fails('call ch_evalexpr(ch, #{method: "ping"}, #{callback: "LspOtCb"})', 'E917:')
18+
- " call ch_logfile('', 'w')
19+
+ call ch_logfile('', 'w')
20+
endfunc
21+
22+
func Test_channel_lsp_mode()
23+
call RunServer('test_channel_lsp.py', 'LspTests', [])
24+
+ if filereadable('Xlsprpc.log')
25+
+ let s1 = "<-- Contents of Xlsprpc.log -->"
26+
+ let s1 ..= readfile('Xlsprpc.log')->string()
27+
+ let s1 ..= "<-- Contents of Xlspdebug.log -->"
28+
+ let s1 ..= readfile('Xlspdebug.log')->string()
29+
+ call assert_report(s1)
30+
+ call delete('Xlsprpc.log')
31+
+ call delete('Xlspdebug.log')
32+
+ endif
33+
endfunc
34+
35+
" vim: shiftwidth=2 sts=2 expandtab
36+
diff --git a/src/testdir/test_channel_lsp.py b/src/testdir/test_channel_lsp.py
37+
index 530258d84..f901398a9 100644
38+
--- a/src/testdir/test_channel_lsp.py
39+
+++ b/src/testdir/test_channel_lsp.py
40+
@@ -228,7 +228,7 @@ class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
41+
42+
def handle(self):
43+
print("=== socket opened ===")
44+
- self.debug = False
45+
+ self.debug = True
46+
msgbuf = ''
47+
while True:
48+
try:

0 commit comments

Comments
 (0)