diff --git a/nixd/include/nixd/Controller/Controller.h b/nixd/include/nixd/Controller/Controller.h index cfad6331d..1f4ac3611 100644 --- a/nixd/include/nixd/Controller/Controller.h +++ b/nixd/include/nixd/Controller/Controller.h @@ -140,7 +140,7 @@ class Controller : public lspserver::LSPServer { void actOnDocumentAdd(lspserver::PathRef File, std::optional Version); - void removeDocument(lspserver::PathRef File) { Store.removeDraft(File); } + void removeDocument(lspserver::PathRef File); void onInitialize(const lspserver::InitializeParams &Params, lspserver::Callback Reply); diff --git a/nixd/lib/Controller/Support.cpp b/nixd/lib/Controller/Support.cpp index a3a303c98..8c90c8fb0 100644 --- a/nixd/lib/Controller/Support.cpp +++ b/nixd/lib/Controller/Support.cpp @@ -27,7 +27,13 @@ std::string getShmName(std::string_view File) { } // namespace -namespace nixd { +void Controller::removeDocument(lspserver::PathRef File) { + Store.removeDraft(File); + { + std::lock_guard _(TUsLock); + TUs.erase(File); + } +} void Controller::actOnDocumentAdd(PathRef File, std::optional Version) { @@ -167,5 +173,3 @@ Controller::Controller(std::unique_ptr In, EndWorkDoneProgress = mkOutNotifiction>("$/progress"); } - -} // namespace nixd