[PATCH] D56540: [clangd] Clean the cache of file statuses on vscode-clangd when clangd crashes.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 22 07:28:09 PST 2019


ilya-biryukov accepted this revision.
ilya-biryukov added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clangd/clients/clangd-vscode/src/extension.ts:127
+                    (fileStatus) => { status.onFileUpdated(fileStatus); });
+            } else if (newState == vscodelc.State.Stopped) {
+                // Clear all cached statuses when clangd crashes.
----------------
This looks scary, if we end up doing that in too many places, the code would become completely unreadable.

Have no idea how to make it better, but a very general observation is that we'd be better off with dropping all the state we have when clangd crashes and starting from scratch, rather than trying to keep old components and bring them into a sensible state when crashes happen.

No need to do anything right now, just something to keep in mind for the future.


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56540/new/

https://reviews.llvm.org/D56540





More information about the cfe-commits mailing list