Skip to content

Commit

Permalink
Added unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
orbitalquark committed Aug 26, 2024
1 parent 234f829 commit 1231de7
Show file tree
Hide file tree
Showing 4 changed files with 390 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .luacov
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include = {'lsp'}
exclude = {'_test'}
22 changes: 10 additions & 12 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1233,18 +1233,16 @@ end)
-- If the buffer has active diagnostics and has since been modified, ask the server for updated
-- diagnostics.
-- TODO: investigate using textDocument/diagnostic method and response. For now this is passive.
if not CURSES then
timeout(1, function()
if not buffer._lsp_diagnostic_time or not buffer._lsp_mod_time then return true end
local server = get_server()
if not server then return true end
if buffer._lsp_mod_time > buffer._lsp_diagnostic_time then
server:sync_buffer()
buffer._lsp_mod_time, buffer._lsp_diagnostic_time = nil, nil
end
return true
end)
end
timeout(1, function()
if not buffer._lsp_diagnostic_time or not buffer._lsp_mod_time then return true end
local server = get_server()
if not server then return true end
if buffer._lsp_mod_time > buffer._lsp_diagnostic_time then
server:sync_buffer()
buffer._lsp_mod_time, buffer._lsp_diagnostic_time = nil, nil
end
return true
end)

-- Add a menu.
-- (Insert 'Language Server' menu in alphabetical order.)
Expand Down
Loading

0 comments on commit 1231de7

Please sign in to comment.