[PATCH] D50446: [clangd] Record the currently active file in context for codeCompletion and findDefinitions.

2018-08-08 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Ok, I am convinced :) Putting the context key into TUScheduler.cpp and exposing a static method to access it sound like a better idea afterall. Thanks for the suggestions! Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50446

[PATCH] D50446: [clangd] Record the currently active file in context for codeCompletion and findDefinitions.

2018-08-08 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 159746. ioeric marked 3 inline comments as done. ioeric added a comment. Herald added a subscriber: javed.absar. - Addressed review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50446 Files: clangd/TUScheduler.cpp

[PATCH] D50446: [clangd] Record the currently active file in context for codeCompletion and findDefinitions.

2018-08-08 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/ClangdServer.cpp:162 +WithContextValue WithFileName(kActiveFile, File); // FIXME(ibiryukov): even if Preamble is non-null, we may want to check ioeric wrote: > ilya-biryukov wrote: > > If we want

[PATCH] D50446: [clangd] Record the currently active file in context for codeCompletion and findDefinitions.

2018-08-08 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D50446#1192282, @ilya-biryukov wrote: > Short summary of the offline discussion: I suggest adding this parameter into > the corresponding requests of the index (FuzzyFindRequest, > FindDefinitionsRequest) instead of stashing it in the

[PATCH] D50446: [clangd] Record the currently active file in context for codeCompletion and findDefinitions.

2018-08-08 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Short summary of the offline discussion: I suggest adding this parameter into the corresponding requests of the index (FuzzyFindRequest, FindDefinitionsRequest) instead of stashing it in the context. Context has all the same problems as the global variables, so

[PATCH] D50446: [clangd] Record the currently active file in context for codeCompletion and findDefinitions.

2018-08-08 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay. This allows implementations like different symbol indexes to know what the current active file is. For example, some customized index implementation might