Skip to content

Commit a6a5205

Browse files
committed
Do not log buffer contents returned from server
1 parent 87f4093 commit a6a5205

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

autoload/OmniSharp/log.vim

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,17 @@ function! OmniSharp#log#LogServer(job, raw, msg) abort
2828
" in linux
2929
let message = substitute(a:msg.Body.Message, '\%uD\ze\%u0', '', 'g')
3030
let lines = split(message, '\%u0', 1)
31-
if g:OmniSharp_loglevel ==# 'DEBUG' && lines[0] =~# '^\*\{12\}'
31+
if a:msg.Body.Name ==# 'OmniSharp.Roslyn.BufferManager'
32+
let line0 = lines[0]
33+
if lines[0] =~# '^\s*Updating file .\+ with new text:$'
34+
" Strip the trailing ':'
35+
let line0 = line0[:-2]
36+
endif
37+
" The server sends the full content of the buffer. Don't log it.
38+
let prefix = s:LogLevelPrefix(a:msg.Body.LogLevel)
39+
let lines = [printf('[%s]: %s\n', prefix, a:msg.Body.Name), line0]
40+
call writefile(lines, a:job.logfile, 'a')
41+
elseif g:OmniSharp_loglevel ==# 'DEBUG' && lines[0] =~# '^\*\{12\}'
3242
" Special loglevel - DEBUG all caps. This still tells the server to pass
3343
" full debugging requests and responses plus debugging messages, but
3444
" OmniSharp-vim will not log the requests and responses - just record

0 commit comments

Comments
 (0)