aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/lsp.txt2
-rw-r--r--runtime/filetype.vim9
-rw-r--r--runtime/lua/vim/lsp.lua4
-rw-r--r--runtime/lua/vim/lsp/diagnostic.lua11
-rw-r--r--runtime/lua/vim/lsp/util.lua1
-rw-r--r--src/nvim/edit.c117
-rw-r--r--src/nvim/message.c7
-rw-r--r--src/nvim/search.c15
-rw-r--r--src/nvim/spell.c9
-rw-r--r--src/nvim/spell.h1
-rw-r--r--src/nvim/testdir/test_filetype.vim18
-rw-r--r--src/nvim/testdir/test_ins_complete.vim18
-rw-r--r--src/nvim/testdir/test_utf8.vim11
-rw-r--r--test/functional/plugin/lsp/diagnostic_spec.lua14
-rw-r--r--test/functional/plugin/lsp_spec.lua46
15 files changed, 198 insertions, 85 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 78829fbba1..c8a44dfb75 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -1049,7 +1049,7 @@ get_all() *vim.lsp.diagnostic.get_all()*
Get all diagnostics for all clients
Return: ~
- Diagnostic[]
+ {bufnr:Diagnostic[]}
*vim.lsp.diagnostic.get_count()*
get_count({bufnr}, {severity}, {client_id})
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index b9d2a43d5d..ed19fa1a43 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1768,8 +1768,13 @@ au BufNewFile,BufReadPost *.tutor setf tutor
" TWIG files
au BufNewFile,BufReadPost *.twig setf twig
-" Typescript
-au BufNewFile,BufReadPost *.ts setf typescript
+" Typescript or Qt translation file (which is XML)
+au BufNewFile,BufReadPost *.ts
+ \ if getline(1) =~ '<?xml' |
+ \ setf xml |
+ \ else |
+ \ setf typescript |
+ \ endif
" TypeScript with React
au BufNewFile,BufRead *.tsx setf typescriptreact
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua
index 92f56b2ddf..f082fe29f2 100644
--- a/runtime/lua/vim/lsp.lua
+++ b/runtime/lua/vim/lsp.lua
@@ -1032,9 +1032,9 @@ function lsp.buf_request(bufnr, method, params, handler)
end
end)
- -- if no clients support the given method, call the handler with the proper
+ -- if has client but no clients support the given method, call the callback with the proper
-- error message.
- if not method_supported then
+ if not tbl_isempty(all_buffer_active_clients[resolve_bufnr(bufnr)] or {}) and not method_supported then
local unsupported_err = lsp._unsupported_method(method)
handler = handler or lsp.handlers[method]
if handler then
diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua
index 1570d4a122..27a1f53f89 100644
--- a/runtime/lua/vim/lsp/diagnostic.lua
+++ b/runtime/lua/vim/lsp/diagnostic.lua
@@ -308,15 +308,16 @@ end
--- Get all diagnostics for all clients
---
----@return Diagnostic[]
+---@return {bufnr: Diagnostic[]}
function M.get_all()
- local all_diagnostics = {}
- for _, buf_diagnostics in pairs(diagnostic_cache) do
+ local diagnostics_by_bufnr = {}
+ for bufnr, buf_diagnostics in pairs(diagnostic_cache) do
+ diagnostics_by_bufnr[bufnr] = {}
for _, client_diagnostics in pairs(buf_diagnostics) do
- vim.list_extend(all_diagnostics, client_diagnostics)
+ vim.list_extend(diagnostics_by_bufnr[bufnr], client_diagnostics)
end
end
- return all_diagnostics
+ return diagnostics_by_bufnr
end
--- Return associated diagnostics for bufnr
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index f78a36fda2..5804ac6656 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -957,6 +957,7 @@ function M.open_floating_preview(contents, filetype, opts)
end
api.nvim_buf_set_lines(floating_bufnr, 0, -1, true, contents)
api.nvim_buf_set_option(floating_bufnr, 'modifiable', false)
+ api.nvim_buf_set_option(floating_bufnr, 'bufhidden', 'wipe')
M.close_preview_autocmd({"CursorMoved", "CursorMovedI", "BufHidden", "BufLeave"}, floating_winnr)
return floating_bufnr, floating_winnr
end
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 5d44c3274e..7fefa8520a 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -196,8 +196,8 @@ static int ctrl_x_mode = CTRL_X_NORMAL;
static int compl_matches = 0;
static char_u *compl_pattern = NULL;
-static int compl_direction = FORWARD;
-static int compl_shows_dir = FORWARD;
+static Direction compl_direction = FORWARD;
+static Direction compl_shows_dir = FORWARD;
static int compl_pending = 0; // > 1 for postponed CTRL-N
static pos_T compl_startpos;
static colnr_T compl_col = 0; /* column where the text starts
@@ -2156,7 +2156,7 @@ static bool ins_compl_accept_char(int c)
///
/// @param[in] cont_s_ipos next ^X<> will set initial_pos
int ins_compl_add_infercase(char_u *str_arg, int len, bool icase, char_u *fname,
- int dir, bool cont_s_ipos)
+ Direction dir, bool cont_s_ipos)
FUNC_ATTR_NONNULL_ARG(1)
{
char_u *str = str_arg;
@@ -2308,7 +2308,7 @@ static int ins_compl_add(char_u *const str, int len,
FUNC_ATTR_NONNULL_ARG(1)
{
compl_T *match;
- int dir = (cdir == kDirectionNotSet ? compl_direction : cdir);
+ const Direction dir = (cdir == kDirectionNotSet ? compl_direction : cdir);
int flags = flags_arg;
os_breakcheck();
@@ -2511,7 +2511,7 @@ static void ins_compl_add_matches(int num_matches, char_u **matches, int icase)
FUNC_ATTR_NONNULL_ALL
{
int add_r = OK;
- int dir = compl_direction;
+ Direction dir = compl_direction;
for (int i = 0; i < num_matches && add_r != FAIL; i++) {
if ((add_r = ins_compl_add(matches[i], -1, NULL, NULL, false, NULL, dir,
@@ -2864,7 +2864,7 @@ ins_compl_dictionaries (
char_u **files;
int count;
int save_p_scs;
- int dir = compl_direction;
+ Direction dir = compl_direction;
if (*dict == NUL) {
/* When 'dictionary' is empty and spell checking is enabled use
@@ -2945,7 +2945,10 @@ theend:
xfree(buf);
}
-static void ins_compl_files(int count, char_u **files, int thesaurus, int flags, regmatch_T *regmatch, char_u *buf, int *dir)
+static void ins_compl_files(int count, char_u **files, int thesaurus,
+ int flags, regmatch_T *regmatch, char_u *buf,
+ Direction *dir)
+ FUNC_ATTR_NONNULL_ARG(2, 7)
{
char_u *ptr;
int i;
@@ -3137,6 +3140,56 @@ bool ins_compl_active(void)
return compl_started;
}
+static void ins_compl_update_sequence_numbers(void)
+{
+ int number = 0;
+ compl_T *match;
+
+ if (compl_direction == FORWARD) {
+ // search backwards for the first valid (!= -1) number.
+ // This should normally succeed already at the first loop
+ // cycle, so it's fast!
+ for (match = compl_curr_match->cp_prev;
+ match != NULL && match != compl_first_match;
+ match = match->cp_prev) {
+ if (match->cp_number != -1) {
+ number = match->cp_number;
+ break;
+ }
+ }
+ if (match != NULL) {
+ // go up and assign all numbers which are not assigned yet
+ for (match = match->cp_next;
+ match != NULL && match->cp_number == -1;
+ match = match->cp_next) {
+ match->cp_number = ++number;
+ }
+ }
+ } else { // BACKWARD
+ assert(compl_direction == BACKWARD);
+ // search forwards (upwards) for the first valid (!= -1)
+ // number. This should normally succeed already at the
+ // first loop cycle, so it's fast!
+ for (match = compl_curr_match->cp_next;
+ match != NULL && match != compl_first_match;
+ match = match->cp_next) {
+ if (match->cp_number != -1) {
+ number = match->cp_number;
+ break;
+ }
+ }
+ if (match != NULL) {
+ // go down and assign all numbers which are not
+ // assigned yet
+ for (match = match->cp_prev;
+ match && match->cp_number == -1;
+ match = match->cp_prev) {
+ match->cp_number = ++number;
+ }
+ }
+ }
+}
+
// Get complete information
void get_complete_info(list_T *what_list, dict_T *retdict)
{
@@ -3214,6 +3267,9 @@ void get_complete_info(list_T *what_list, dict_T *retdict)
}
if (ret == OK && (what_flag & CI_WHAT_SELECTED)) {
+ if (compl_curr_match != NULL && compl_curr_match->cp_number == -1) {
+ ins_compl_update_sequence_numbers();
+ }
ret = tv_dict_add_nr(retdict, S_LEN("selected"),
(compl_curr_match != NULL)
? compl_curr_match->cp_number - 1 : -1);
@@ -3865,7 +3921,7 @@ theend:
*/
static void ins_compl_add_list(list_T *const list)
{
- int dir = compl_direction;
+ Direction dir = compl_direction;
// Go through the List with matches and add each of them.
TV_LIST_ITER(list, li, {
@@ -5242,52 +5298,11 @@ static int ins_complete(int c, bool enable_pum)
} else if (compl_curr_match->cp_next == compl_curr_match->cp_prev) {
edit_submode_extra = (char_u *)_("The only match");
edit_submode_highl = HLF_COUNT;
+ compl_curr_match->cp_number = 1;
} else {
// Update completion sequence number when needed.
if (compl_curr_match->cp_number == -1) {
- int number = 0;
- compl_T *match;
-
- if (compl_direction == FORWARD) {
- /* search backwards for the first valid (!= -1) number.
- * This should normally succeed already at the first loop
- * cycle, so it's fast! */
- for (match = compl_curr_match->cp_prev; match != NULL
- && match != compl_first_match;
- match = match->cp_prev)
- if (match->cp_number != -1) {
- number = match->cp_number;
- break;
- }
- if (match != NULL)
- /* go up and assign all numbers which are not assigned
- * yet */
- for (match = match->cp_next;
- match != NULL && match->cp_number == -1;
- match = match->cp_next)
- match->cp_number = ++number;
- } else { // BACKWARD
- // search forwards (upwards) for the first valid (!= -1)
- // number. This should normally succeed already at the
- // first loop cycle, so it's fast!
- for (match = compl_curr_match->cp_next;
- match != NULL && match != compl_first_match;
- match = match->cp_next) {
- if (match->cp_number != -1) {
- number = match->cp_number;
- break;
- }
- }
- if (match != NULL) {
- // go down and assign all numbers which are not
- // assigned yet
- for (match = match->cp_prev;
- match && match->cp_number == -1;
- match = match->cp_prev) {
- match->cp_number = ++number;
- }
- }
- }
+ ins_compl_update_sequence_numbers();
}
/* The match should always have a sequence number now, this is
diff --git a/src/nvim/message.c b/src/nvim/message.c
index f76a408481..ad38e6d060 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -1711,8 +1711,11 @@ void msg_prt_line(char_u *s, int list)
} else if ((l = utfc_ptr2len(s)) > 1) {
col += utf_ptr2cells(s);
char buf[MB_MAXBYTES + 1];
- if (curwin->w_p_lcs_chars.nbsp != NUL && list
- && (utf_ptr2char(s) == 160 || utf_ptr2char(s) == 0x202f)) {
+ if (l >= MB_MAXBYTES) {
+ xstrlcpy(buf, "¿", sizeof(buf));
+ } else if (curwin->w_p_lcs_chars.nbsp != NUL && list
+ && (utf_ptr2char(s) == 160
+ || utf_ptr2char(s) == 0x202f)) {
utf_char2bytes(curwin->w_p_lcs_chars.nbsp, (char_u *)buf);
buf[utfc_ptr2len((char_u *)buf)] = NUL;
} else {
diff --git a/src/nvim/search.c b/src/nvim/search.c
index 90e1e25de2..787a464070 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -89,7 +89,7 @@ static struct spat spats[2] =
static int last_idx = 0; /* index in spats[] for RE_LAST */
static char_u lastc[2] = { NUL, NUL }; // last character searched for
-static int lastcdir = FORWARD; // last direction of character search
+static Direction lastcdir = FORWARD; // last direction of character search
static int last_t_cmd = true; // last search t_cmd
static char_u lastc_bytes[MB_MAXBYTES + 1];
static int lastc_bytelen = 1; // >1 for multi-byte char
@@ -437,7 +437,7 @@ void set_last_csearch(int c, char_u *s, int len)
memset(lastc_bytes, 0, sizeof(lastc_bytes));
}
-void set_csearch_direction(int cdir)
+void set_csearch_direction(Direction cdir)
{
lastcdir = cdir;
}
@@ -1430,7 +1430,7 @@ end_do_search:
* ADDING is set. If p_ic is set then the pattern must be in lowercase.
* Return OK for success, or FAIL if no line found.
*/
-int search_for_exact_line(buf_T *buf, pos_T *pos, int dir, char_u *pat)
+int search_for_exact_line(buf_T *buf, pos_T *pos, Direction dir, char_u *pat)
{
linenr_T start = 0;
char_u *ptr;
@@ -1496,10 +1496,11 @@ int search_for_exact_line(buf_T *buf, pos_T *pos, int dir, char_u *pat)
* Return FAIL or OK.
*/
int searchc(cmdarg_T *cap, int t_cmd)
+ FUNC_ATTR_NONNULL_ALL
{
- int c = cap->nchar; /* char to search for */
- int dir = cap->arg; /* TRUE for searching forward */
- long count = cap->count1; /* repeat count */
+ int c = cap->nchar; // char to search for
+ Direction dir = cap->arg; // TRUE for searching forward
+ long count = cap->count1; // repeat count
int col;
char_u *p;
int len;
@@ -4462,7 +4463,7 @@ static void search_stat(int dirc, pos_T *pos,
void
find_pattern_in_path(
char_u *ptr, // pointer to search pattern
- int dir, // direction of expansion
+ Direction dir, // direction of expansion
size_t len, // length of search pattern
bool whole, // match whole words only
bool skip_comments, // don't match inside comments
diff --git a/src/nvim/spell.c b/src/nvim/spell.c
index 797fe41320..5714f5e425 100644
--- a/src/nvim/spell.c
+++ b/src/nvim/spell.c
@@ -79,7 +79,6 @@
/* for offsetof() */
#include <stddef.h>
-#include "nvim/vim.h"
#include "nvim/ascii.h"
#include "nvim/spell.h"
#include "nvim/buffer.h"
@@ -6653,7 +6652,7 @@ void
spell_dump_compl (
char_u *pat, // leading part of the word
int ic, // ignore case
- int *dir, // direction for adding matches
+ Direction *dir, // direction for adding matches
int dumpflags_arg // DUMPFLAG_*
)
{
@@ -6820,7 +6819,9 @@ spell_dump_compl (
// Dumps one word: apply case modifications and append a line to the buffer.
// When "lnum" is zero add insert mode completion.
-static void dump_word(slang_T *slang, char_u *word, char_u *pat, int *dir, int dumpflags, int wordflags, linenr_T lnum)
+static void dump_word(slang_T *slang, char_u *word, char_u *pat,
+ Direction *dir, int dumpflags, int wordflags,
+ linenr_T lnum)
{
bool keepcap = false;
char_u *p;
@@ -6906,7 +6907,7 @@ dump_prefixes (
slang_T *slang,
char_u *word, // case-folded word
char_u *pat,
- int *dir,
+ Direction *dir,
int dumpflags,
int flags, // flags with prefix ID
linenr_T startlnum
diff --git a/src/nvim/spell.h b/src/nvim/spell.h
index ad66df4c5d..e93c82b91d 100644
--- a/src/nvim/spell.h
+++ b/src/nvim/spell.h
@@ -6,6 +6,7 @@
#include "nvim/spell_defs.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/globals.h"
+#include "nvim/vim.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "spell.h.generated.h"
diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim
index 52b5884c8b..f3c3e085f6 100644
--- a/src/nvim/testdir/test_filetype.vim
+++ b/src/nvim/testdir/test_filetype.vim
@@ -471,7 +471,6 @@ let s:filename_checks = {
\ 'tssgm': ['file.tssgm'],
\ 'tssop': ['file.tssop'],
\ 'twig': ['file.twig'],
- \ 'typescript': ['file.ts'],
\ 'typescriptreact': ['file.tsx'],
\ 'uc': ['file.uc'],
\ 'udevconf': ['/etc/udev/udev.conf'],
@@ -668,5 +667,22 @@ func Test_hook_file()
filetype off
endfunc
+func Test_ts_file()
+ filetype on
+
+ call writefile(['<?xml version="1.0" encoding="utf-8"?>'], 'Xfile.ts')
+ split Xfile.ts
+ call assert_equal('xml', &filetype)
+ bwipe!
+
+ call writefile(['// looks like Typescript'], 'Xfile.ts')
+ split Xfile.ts
+ call assert_equal('typescript', &filetype)
+ bwipe!
+
+ call delete('Xfile.hook')
+ filetype off
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_ins_complete.vim b/src/nvim/testdir/test_ins_complete.vim
index 57a0a7aaf4..6fe1d29434 100644
--- a/src/nvim/testdir/test_ins_complete.vim
+++ b/src/nvim/testdir/test_ins_complete.vim
@@ -312,6 +312,24 @@ func Test_completefunc_args()
delfunc CompleteFunc
endfunc
+func CompleteTest(findstart, query)
+ if a:findstart
+ return col('.')
+ endif
+ return ['matched']
+endfunc
+
+func Test_completefunc_info()
+ new
+ set completeopt=menuone
+ set completefunc=CompleteTest
+ call feedkeys("i\<C-X>\<C-U>\<C-R>\<C-R>=string(complete_info())\<CR>\<ESC>", "tx")
+ call assert_equal("matched{'pum_visible': 1, 'mode': 'function', 'selected': 0, 'items': [{'word': 'matched', 'menu': '', 'user_data': '', 'info': '', 'kind': '', 'abbr': ''}]}", getline(1))
+ bwipe!
+ set completeopt&
+ set completefunc&
+endfunc
+
" Check that when using feedkeys() typeahead does not interrupt searching for
" completions.
func Test_compl_feedkeys()
diff --git a/src/nvim/testdir/test_utf8.vim b/src/nvim/testdir/test_utf8.vim
index 8302ccb67f..e8161f8fcb 100644
--- a/src/nvim/testdir/test_utf8.vim
+++ b/src/nvim/testdir/test_utf8.vim
@@ -103,3 +103,14 @@ func Test_list2str_str2list_latin1()
call assert_equal(l, lres)
call assert_equal(s, sres)
endfunc
+
+func Test_print_overlong()
+ " Text with more composing characters than MB_MAXBYTES.
+ new
+ call setline(1, 'axxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
+ s/x/\=nr2char(1629)/g
+ print
+ bwipe!
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab
diff --git a/test/functional/plugin/lsp/diagnostic_spec.lua b/test/functional/plugin/lsp/diagnostic_spec.lua
index 11b2beba7a..3a676359ab 100644
--- a/test/functional/plugin/lsp/diagnostic_spec.lua
+++ b/test/functional/plugin/lsp/diagnostic_spec.lua
@@ -68,20 +68,23 @@ describe('vim.lsp.diagnostic', function()
describe('vim.lsp.diagnostic', function()
describe('handle_publish_diagnostics', function()
it('should be able to retrieve diagnostics from all buffers and clients', function()
- eq(3, exec_lua [[
+ local result = exec_lua [[
vim.lsp.diagnostic.save(
{
make_error('Diagnostic #1', 1, 1, 1, 1),
make_error('Diagnostic #2', 2, 1, 2, 1),
- }, 0, 1
+ }, 1, 1
)
vim.lsp.diagnostic.save(
{
make_error('Diagnostic #3', 3, 1, 3, 1),
- }, 1, 2
+ }, 2, 2
)
- return #vim.lsp.diagnostic.get_all()
- ]])
+ return vim.lsp.diagnostic.get_all()
+ ]]
+ eq(2, #result)
+ eq(2, #result[1])
+ eq('Diagnostic #1', result[1][1].message)
end)
it('should be able to save and count a single client error', function()
eq(1, exec_lua [[
@@ -153,7 +156,6 @@ describe('vim.lsp.diagnostic', function()
}
]])
end)
-
it('should handle one server clearing highlights while the other still has highlights', function()
-- 1 Error (1)
-- 1 Warning (2)
diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua
index 5b048f57e9..f01d90bbeb 100644
--- a/test/functional/plugin/lsp_spec.lua
+++ b/test/functional/plugin/lsp_spec.lua
@@ -323,23 +323,61 @@ describe('LSP', function()
test_name = "capabilities_for_client_supports_method";
on_setup = function()
exec_lua([=[
- vim.lsp.handlers['textDocument/hover'] = function(err, method)
+ BUFFER = vim.api.nvim_get_current_buf()
+ lsp.buf_attach_client(BUFFER, TEST_RPC_CLIENT_ID)
+ vim.lsp.callbacks['textDocument/typeDefinition'] = function(err, method)
vim.lsp._last_lsp_callback = { err = err; method = method }
end
vim.lsp._unsupported_method = function(method)
vim.lsp._last_unsupported_method = method
return 'fake-error'
end
- vim.lsp.buf.hover()
+ vim.lsp.buf.type_definition()
]=])
end;
on_init = function(client)
client.stop()
local method = exec_lua("return vim.lsp._last_unsupported_method")
- eq("textDocument/hover", method)
+ eq("textDocument/typeDefinition", method)
local lsp_cb_call = exec_lua("return vim.lsp._last_lsp_callback")
eq("fake-error", lsp_cb_call.err)
- eq("textDocument/hover", lsp_cb_call.method)
+ eq("textDocument/typeDefinition", lsp_cb_call.method)
+ exec_lua [[
+ vim.api.nvim_command(BUFFER.."bwipeout")
+ ]]
+ end;
+ on_exit = function(code, signal)
+ eq(0, code, "exit code", fake_lsp_logfile)
+ eq(0, signal, "exit signal", fake_lsp_logfile)
+ end;
+ on_callback = function(...)
+ eq(table.remove(expected_callbacks), {...}, "expected callback")
+ end;
+ }
+ end)
+
+ it('shouldn\'t call unsupported_method when no client and trying to call an unsupported method', function()
+ local expected_callbacks = {
+ {NIL, "shutdown", {}, 1};
+ }
+ test_rpc_server {
+ test_name = "capabilities_for_client_supports_method";
+ on_setup = function()
+ exec_lua([=[
+ vim.lsp.callbacks['textDocument/typeDefinition'] = function(err, method)
+ vim.lsp._last_lsp_callback = { err = err; method = method }
+ end
+ vim.lsp._unsupported_method = function(method)
+ vim.lsp._last_unsupported_method = method
+ return 'fake-error'
+ end
+ vim.lsp.buf.type_definition()
+ ]=])
+ end;
+ on_init = function(client)
+ client.stop()
+ eq(NIL, exec_lua("return vim.lsp._last_unsupported_method"))
+ eq(NIL, exec_lua("return vim.lsp._last_lsp_callback"))
end;
on_exit = function(code, signal)
eq(0, code, "exit code", fake_lsp_logfile)