Skip to content

Commit

Permalink
nixd: remove NixTU after 'didClose'
Browse files Browse the repository at this point in the history
  • Loading branch information
inclyc committed Apr 19, 2024
1 parent 2e51fe0 commit f97cd39
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nixd/include/nixd/Controller/Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class Controller : public lspserver::LSPServer {
void actOnDocumentAdd(lspserver::PathRef File,
std::optional<int64_t> Version);

void removeDocument(lspserver::PathRef File) { Store.removeDraft(File); }
void removeDocument(lspserver::PathRef File);

void onInitialize(const lspserver::InitializeParams &Params,
lspserver::Callback<llvm::json::Value> Reply);
Expand Down
10 changes: 7 additions & 3 deletions nixd/lib/Controller/Support.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int64_t> Version) {
Expand Down Expand Up @@ -167,5 +173,3 @@ Controller::Controller(std::unique_ptr<lspserver::InboundPort> In,
EndWorkDoneProgress =
mkOutNotifiction<ProgressParams<WorkDoneProgressEnd>>("$/progress");
}

} // namespace nixd

0 comments on commit f97cd39

Please sign in to comment.