[PATCH] D77392: [WIP][clangd] Make signatureHelp work with stale preambles

2020-04-21 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 258915. kadircet marked 2 inline comments as done. kadircet added a comment. - Make scanPreambleIncludes return an Expected> - Bail out in case of errors, document the rational. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revi

[PATCH] D77392: [WIP][clangd] Make signatureHelp work with stale preambles

2020-04-21 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet marked an inline comment as done. kadircet added inline comments. Comment at: clang-tools-extra/clangd/Preamble.cpp:281 + // We are only interested in newly added includes. + llvm::StringSet<> ExistingIncludes; + for (const auto &Inc : Preamble.LexedIncludes)

[PATCH] D77392: [WIP][clangd] Make signatureHelp work with stale preambles

2020-04-20 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land. Keep missing the "ship it" button... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77392/new/ https://reviews.llvm.org/D77392 _

[PATCH] D77392: [WIP][clangd] Make signatureHelp work with stale preambles

2020-04-20 Thread Sam McCall via Phabricator via cfe-commits
sammccall marked an inline comment as done. sammccall added a comment. Great stuff! Comment at: clang-tools-extra/clangd/Preamble.cpp:281 + // We are only interested in newly added includes. + llvm::StringSet<> ExistingIncludes; + for (const auto &Inc : Preamble.LexedInclude

[PATCH] D77392: [WIP][clangd] Make signatureHelp work with stale preambles

2020-04-20 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 258833. kadircet marked 2 inline comments as done. kadircet added a comment. - Address comments - Don't store LexedInclude in PreambleData, expose the contents in PrecompiledPreamble instead. - Introduce DenseMapInfo for PPKeywordKind Repository: rG LLVM

[PATCH] D77392: [WIP][clangd] Make signatureHelp work with stale preambles

2020-04-20 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet marked 15 inline comments as done. kadircet added inline comments. Comment at: clang-tools-extra/clangd/Preamble.cpp:278 + // This shouldn't coincide with any real file name. + PP.PatchFileName = llvm::formatv("{0}_preamble_patch.h", FileName); + sammc

[PATCH] D77392: [WIP][clangd] Make signatureHelp work with stale preambles

2020-04-19 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. This looks pretty good! Haven't reviewed the tests or removal of consistent preamble support yet. (Mostly note-to-self) Comment at: clang-tools-extra/clangd/Preamble.cpp:115 +do { + PP.Lex(Tok); +} while (Tok.isNot(tok::eof) && -

[PATCH] D77392: [WIP][clangd] Make signatureHelp work with stale preambles

2020-04-16 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added a comment. This is ready for another round. To summarize the current state: - `PreamblePatch` can be create from a `ParseInput` and a `PreambleData`, - It will preprocessor preamble section of current file contents using a dummy FS to reduce cost of stat/realpaths - It won't p

[PATCH] D77392: [WIP][clangd] Make signatureHelp work with stale preambles

2020-04-16 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 258064. kadircet added a comment. - Use preprocessor instead of raw lexer Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77392/new/ https://reviews.llvm.org/D77392 Files: clang-tools-extra/clangd/ClangdServe

[PATCH] D77392: [WIP][clangd] Make signatureHelp work with stale preambles

2020-04-09 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet marked 3 inline comments as done. kadircet added inline comments. Comment at: clang-tools-extra/clangd/CodeComplete.cpp:1076 + if (PatchAdditionalIncludes) { +for (const auto &Inc : newIncludes( + Input.Preamble.LexedIncludes, sammccall

[PATCH] D77392: [WIP][clangd] Make signatureHelp work with stale preambles

2020-04-09 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 256359. kadircet added a comment. Herald added a subscriber: mgorny. - Encapsulate logic into `PreamblePatch` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77392/new/ https://reviews.llvm.org/D77392 Files:

[PATCH] D77392: [WIP][clangd] Make signatureHelp work with stale preambles

2020-04-07 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. This is the perfect feature to start with (doesn't actually need any location transforms, lets us drop TUScheduler features), so well done for finding that. That said, high-level comments mostly about preamble patching in general rather than this particular case. =