-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #395 from cameronr/main
Fix: #208 stop LSs when restoring session
- Loading branch information
Showing
6 changed files
with
109 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
local TL = require "tests/test_lib" | ||
|
||
describe("lsp_stop_on_restore", function() | ||
local as = require "auto-session" | ||
as.setup {} | ||
TL.clearSessionFilesAndBuffers() | ||
vim.cmd("e " .. TL.test_file) | ||
as.SaveSession() | ||
|
||
it("calls user function on restore", function() | ||
local stop_called = false | ||
as.setup { | ||
lsp_stop_on_restore = function() | ||
stop_called = true | ||
end, | ||
} | ||
|
||
as.RestoreSession() | ||
|
||
assert.True(stop_called) | ||
end) | ||
|
||
it("doesn't try to stop ls on initial autorestore", function() | ||
local stop_called = false | ||
as.setup { | ||
lsp_stop_on_restore = function() | ||
stop_called = true | ||
end, | ||
} | ||
|
||
as.auto_restore_session_at_vim_enter() | ||
|
||
assert.False(stop_called) | ||
end) | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
require "plenary" | ||
local asLib = require "auto-session.lib" | ||
local M = {} | ||
|
||
|