Skip to content

Commit

Permalink
Update init.lua with new config option (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
Infinnitor authored Apr 16, 2023
1 parent 877870b commit 20f33d0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ config.plugins.lsp = common.merge({
log_server_stderr = false,
force_verbosity_off = false,
more_yielding = false,
autostart_server = true,
-- The config specification used by the settings gui
config_spec = {
name = "Language Server Protocol",
Expand Down Expand Up @@ -121,6 +122,13 @@ config.plugins.lsp = common.merge({
min = 100,
max = 10000
},
{
label = "Autostart Server",
description = "Automatically start server when opening a file",
path = "autostart_server",
type = "TOGGLE",
default = true
},
{
label = "Stop Servers",
description = "Stop servers that aren't needed by any of the open files.",
Expand Down Expand Up @@ -2041,7 +2049,7 @@ local root_view_on_mouse_moved = RootView.on_mouse_moved
function Doc:load(...)
local res = doc_load(self, ...)
-- skip new files
if self.filename then
if self.filename and config.plugins.lsp.autostart_server then
diagnostics.lintplus_init_doc(self)
core.add_thread(function()
lsp.start_server(self.filename, core.project_dir)
Expand Down Expand Up @@ -2465,3 +2473,4 @@ end


return lsp

0 comments on commit 20f33d0

Please sign in to comment.