]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
fix: log fs path was not correct
authorshane.xb.qian <shane.qian@foxmail.com>
Fri, 14 Apr 2023 06:09:32 +0000 (14:09 +0800)
committershane.xb.qian <shane.qian@foxmail.com>
Fri, 14 Apr 2023 06:09:32 +0000 (14:09 +0800)
Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
autoload/lsp/completion.vim
autoload/lsp/util.vim

index b487cb59f5732153c6528d134acbada969ae923f..c0afe642819a1c3c0000f51144deee5257d70bfa 100644 (file)
@@ -165,8 +165,6 @@ export def CompletionReply(lspserver: dict<any>, cItems: any)
     endfor
   endif
 
-  #writefile([$'chcol = {chcol}, starttext = [{starttext}], prefix = [{prefix}], start_idx = {start_idx}, end_idx = {end_idx}, start_col = {start_col}'], '/tmp/lspcomplete.log', 'a')
-
   var completeItems: list<dict<any>> = []
   for item in items
     var d: dict<any> = {}
index cb1798e610f34ad46b0a933dceb32c0c968a13cf..a02f79b48adffcad00d32a8e824f6c5c20f5b53c 100644 (file)
@@ -34,7 +34,13 @@ enddef
 
 # Empty out the LSP server trace logs
 export def ClearTraceLogs(fname: string)
-  writefile([], fname)
+  var fullname = $'{lsp_log_dir}{fname}'
+  # If file existed but not writable
+  if filewritable(fullname) != 1 && filereadable(fullname)
+    ErrMsg($'File {fullname} is not writable')
+    return
+  endif
+  writefile([], fullname)
 enddef
 
 # Open the LSP server debug messages file.