Commit f4a75d28 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts
Browse files

lspclient: reload config when restarting all servers

parent 73ee96c6
...@@ -357,7 +357,7 @@ public: ...@@ -357,7 +357,7 @@ public:
} }
} }
} }
restart(servers); restart(servers, server == nullptr);
} }
qint64 revision(KTextEditor::Document *doc) override qint64 revision(KTextEditor::Document *doc) override
...@@ -387,7 +387,7 @@ private: ...@@ -387,7 +387,7 @@ private:
} }
// caller ensures that servers are no longer present in m_servers // caller ensures that servers are no longer present in m_servers
void restart(const ServerList &servers) void restart(const ServerList &servers, bool reload = false)
{ {
// close docs // close docs
for (const auto &server : servers) { for (const auto &server : servers) {
...@@ -429,8 +429,14 @@ private: ...@@ -429,8 +429,14 @@ private:
// as for the start part // as for the start part
// trigger interested parties, which will again request a server as needed // trigger interested parties, which will again request a server as needed
// let's delay this; less chance for server instances to trip over each other // let's delay this; less chance for server instances to trip over each other
QTimer::singleShot(6 * TIMEOUT_SHUTDOWN, this, [this]() { QTimer::singleShot(6 * TIMEOUT_SHUTDOWN, this, [this, reload]() {
Q_EMIT serverChanged(); // this may be a good time to refresh server config
if (reload) {
// will also trigger as mentioned above
updateServerConfig();
} else {
Q_EMIT serverChanged();
}
}); });
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment