diff --git a/src/server/protocol/Client.v b/src/server/protocol/Client.v index 24be6780..58b116d2 100644 --- a/src/server/protocol/Client.v +++ b/src/server/protocol/Client.v @@ -25,6 +25,11 @@ pub fn (mut c Client) progress(params lsp.ProgressParams) { // log_message sends a window/logMessage notification to the client pub fn (mut c Client) log_message(message string, typ lsp.MessageType) { + $if test { + if c == unsafe { nil } { + return + } + } c.wr.write_notify('window/logMessage', lsp.LogMessageParams{ @type: typ message: message diff --git a/src/server/setup_test.v b/src/server/setup_test.v new file mode 100644 index 00000000..a1a163c3 --- /dev/null +++ b/src/server/setup_test.v @@ -0,0 +1,12 @@ +module server + +import os + +fn test_setup_vpaths() { + mut ls := LanguageServer{} + ls.setup() + assert ls.paths.vexe == @VEXE + assert ls.paths.vroot == os.dir(ls.paths.vexe) + assert ls.paths.vmodules_root == os.vmodules_dir() + assert ls.paths.vlib_root == os.join_path(ls.paths.vroot, 'vlib') +}