[PATCH] D54077: [clangd] Implemented DraftFileSystem

Simon Marchi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 5 07:26:52 PST 2018


simark added a comment.

In https://reviews.llvm.org/D54077#1287153, @klimek wrote:

> I'm in yet another camp: I carefully save when I have something that is correct enough syntax, so I only want errors from with changes from the exact file I'm editing and the rest of the files in saved state.


That sounds like the current behavior, doesn't it?

Personally, I would like the behavior proposed by this patch.  I think it perfectly in line with the idea of showing the same diagnostics as the compiler would produce.  It's just that it's what the compiler would produce if compiling the files as seen in the editor.

Also, in the LSP, after a `didOpen` and until the corresponding `didClose`, the source of truth for that file is supposed to be what is in the editor buffer.  So I think it would make sense that if other files include the edited file, they should see the content from the editor.

Of course, that is dependent of having an efficient cancelling mechanism.  Even with some debouncing, an update to a header file can trigger the re-processing of many TUs, so if I do another edit to the same header shortly after, all the queued jobs from the first edit should be dropped.  But I think we already have that, don't we?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D54077





More information about the cfe-commits mailing list