[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. This should make all-scope completion more usable. Scope proximity for indexes will be added in followup patch. Measurements showed a slig

[PATCH] D53034: [clangd] Remove no-op crash handler, we never set a crash context.

2018-10-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. LGTM > Of course the question arises: *should* we set one Agree with your points. If the cleanup is unsafe, it might end up biting us harder in the future. Repository: rCTE Clang Tools Ex

[PATCH] D52979: [clangd] Add removeFile interface in FileIndex.

2018-10-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/FileIndex.h:78 + /// Remove all index data associated with the file \p Path. + void removeFile(PathRef Path); + hokein wrote: > ioeric wrote: > > should we use this somewhere? E.g. when file is closed in Cl

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 169231. ioeric marked 2 inline comments as done. ioeric added a comment. - address review comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53131 Files: clangd/CodeComplete.cpp clangd/Quality.cpp clangd/Quality.h unittests/clan

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/CodeComplete.cpp:558 +if (const auto *NS = dyn_cast(Ctx)) + return NS->getQualifiedNameAsString() + "::"; + return llvm::None; sammccall wrote: > does this do the right thing if it's anonymous or inline,

[PATCH] D53170: [clang-doc] Switch to default to all-TUs executor

2018-10-12 Thread Eric Liu via Phabricator via cfe-commits
ioeric requested changes to this revision. ioeric added inline comments. This revision now requires changes to proceed. Comment at: clang-tools-extra/clang-doc/tool/ClangDocMain.cpp:203 +llvm::Expected> +createClangDocExecutor(int &argc, const char **argv, +

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-12 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Looks good in general. Comment at: clangd/ClangdLSPServer.h:117 +llvm::Optional CompileCommandsDir, +std::function); please document what the callback is for and how often it's called. Comment at: clang

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-12 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added inline comments. This revision is now accepted and ready to land. Comment at: clangd/index/Background.cpp:51 + std::unique_lock Lock(QueueMu); + assert(!HasActiveTask); + QueueCV.wait(Lock, [&] { return ShouldStop || !Que

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-12 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: unittests/clangd/BackgroundIndexTests.cpp:14 + +TEST(BackgroundIndexTest, IndexesOneFile) { + MockFSProvider FS; sammccall wrote: > ioeric wrote: > > Also add a test for `enqueueAll` with multiple TUs ? > Is it important

[PATCH] D53170: [clang-doc] Switch to default to all-TUs executor

2018-10-12 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-tools-extra/clang-doc/tool/ClangDocMain.cpp:89 llvm::cl::init(false), llvm::cl::cat(ClangDocCategory)); +static llvm::cl::opt ClangDocExecutorName( This flag can also be removed. Users can still use `--execut

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-12 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: unittests/clangd/BackgroundIndexTests.cpp:14 + +TEST(BackgroundIndexTest, IndexesOneFile) { + MockFSProvider FS; sammccall wrote: > ioeric wrote: > > sammccall wrote: > > > ioeric wrote: > > > > Also add a test for `enqu

[PATCH] D53284: [CodeComplete] Make sure keyword 'template' is added even when code pattern is disabled.

2018-10-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: sammccall, hokein. Herald added subscribers: cfe-commits, arphaman. Repository: rC Clang https://reviews.llvm.org/D53284 Files: lib/Sema/SemaCodeComplete.cpp test/Index/complete-template-keywords.cpp Index: test/Index/complete-templat

[PATCH] D53284: [CodeComplete] Make sure keyword 'template' is added even when code pattern is disabled.

2018-10-15 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC344509: [CodeComplete] Make sure keyword 'template' is added even when code pattern is… (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D53284?vs=169681&id=169685

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. still lgtm Comment at: clangd/Compiler.cpp:83 +std::string getStandardResourceDir() { + static int Dummy; // Just an address in this process. Maybe also revert this change? Repository: rCTE Clang Too

[PATCH] D53312: [clangd] Support limiting down traversals from sources in FileDistance.

2018-10-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. This is useful for symbo scope proximity, where down traversals from the global scope if not desired. The limitation in the current impleme

[PATCH] D53317: [clangd] Allow disble down traversals from root.

2018-10-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. This is useful for symbo scope proximity, where down traversals from the global scope if not desired. Repository: rCTE Clang Tools Extr

[PATCH] D53312: [clangd] Support limiting down traversals from sources in FileDistance.

2018-10-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric abandoned this revision. ioeric added a comment. As discussed offline, the semantics is getting a bit complicated. As what we really want for scope proximity is just disallow down traversals from root, we can go with special-casing the root path for now: https://reviews.llvm.org/D53317

[PATCH] D53317: [clangd] Allow disble down traversals from root.

2018-10-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 169804. ioeric marked an inline comment as done. ioeric added a comment. - Simplify according to review suggestion. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53317 Files: clangd/FileDistance.cpp clangd/FileDistance.h unittests/cla

[PATCH] D53317: [clangd] Allow disble down traversals from root.

2018-10-16 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE344604: [clangd] Allow disble down traversals from root. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D53317?vs=169804&id=169805#toc Repository: rCTE Clang

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 169814. ioeric marked 3 inline comments as done. ioeric added a comment. - refactor to use FileDistance and address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53131 Files: clangd/AST.cpp clangd/AST.h clangd/CodeCom

[PATCH] D53286: [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction.

2018-10-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Nice! The code looks much clearer. Just some nits Comment at: clangd/ClangdLSPServer.cpp:156 +void ClangdLSPServer::onExit(ExitParams &Params) { + // XXX handler should return true. +} ? Comment at: clangd/ClangdLSPSe

[PATCH] D53286: [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction.

2018-10-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added inline comments. This revision is now accepted and ready to land. Comment at: clangd/JSONRPCDispatcher.h:70 /// A handler responds to requests for a particular method name. + /// It returns true if the server should now shut down.

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Thanks for the suggestions! After taking a closer look at boosting factors for other signals, I think I was being too conservative about boosting preferred scopes and penalizing non-preferred ones. I have tuned the parameters to make these more aggressive now according t

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 169962. ioeric marked 18 inline comments as done. ioeric added a comment. - Addressed review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53131 Files: clangd/AST.cpp clangd/AST.h clangd/CodeComplete.cpp clangd/FileDistanc

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 169982. ioeric marked an inline comment as done. ioeric added a comment. - address comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53131 Files: clangd/AST.cpp clangd/AST.h clangd/CodeComplete.cpp clangd/FileDistance.cpp cla

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 169983. ioeric added a comment. - rebase Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53131 Files: clangd/AST.cpp clangd/AST.h clangd/CodeComplete.cpp clangd/FileDistance.cpp clangd/FileDistance.h clangd/Quality.cpp clangd/Qu

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-17 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL344688: [clangd] Support scope proximity in code completion. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D53131 Files:

[PATCH] D53369: [CodeComplete] Fix accessibility of protected members when accessing members implicitly.

2018-10-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, arphaman. Repository: rC Clang https://reviews.llvm.org/D53369 Files: lib/Sema/SemaCodeComplete.cpp test/Index/complete-access-checks.cpp Index: test/Index/complete-access-checks.

[PATCH] D53374: [clangd] Names that are not spelled in source code are reserved.

2018-10-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. These are often not expected to be used directly e.g. TEST_F(Fixture, X) { ^ // "Fixture_X_Test" expanded in the macro should be do

[PATCH] D53374: [clangd] Names that are not spelled in source code are reserved.

2018-10-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 170046. ioeric marked 3 inline comments as done. ioeric added a comment. - address comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53374 Files: clangd/AST.cpp clangd/AST.h clangd/Quality.cpp clangd/Quality.h clangd/index/In

[PATCH] D53374: [clangd] Names that are not spelled in source code are reserved.

2018-10-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/Quality.cpp:182 if (auto *ID = SemaCCResult.Declaration->getIdentifier()) - ReservedName = ReservedName || isReserved(ID->getName()); + ReservedName = ReservedName || isReserved(ID->getName()) || +

[PATCH] D53387: [clangd] Lay JSONRPCDispatcher to rest.

2018-10-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. lgtm Comment at: clangd/ClangdLSPServer.cpp:148 + if (Trace) +(*Trace)["Reply"] = *Result; + Server.reply(ID, json::Value(std::move(*Result)));

[PATCH] D53374: [clangd] Names that are not spelled in source code are reserved.

2018-10-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 170068. ioeric marked an inline comment as done. ioeric added a comment. - add isImplementationDetail helper Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53374 Files: clangd/AST.cpp clangd/AST.h clangd/Quality.cpp clangd/Quality.h

[PATCH] D53374: [clangd] Names that are not spelled in source code are reserved.

2018-10-18 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL344736: [clangd] Names that are not spelled in source code are reserved. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D5337

[PATCH] D53398: [clangd] Enforce rules around "initialize" request, and create ClangdServer lazily.

2018-10-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. Looks good! Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://

[PATCH] D53399: [clangd] Ensure that we reply to each call exactly once. NFC (I think!)

2018-10-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/ClangdLSPServer.cpp:182 + // - if there were multiple replies, only the first is sent + class ReplyOnce { +struct State { As discussed offline, we could potentially make this non-copyable to make harder to

[PATCH] D53433: [clangd] *Prototype* auto-index stores symbols per-file instead of per-TU.

2018-10-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: sammccall, hokein. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. This allows us to deduplicate header symbols across TUs. File digests are collects when collecting symbols/refs. And the index store

[PATCH] D53369: [CodeComplete] Fix accessibility of protected members when accessing members implicitly.

2018-10-22 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC344889: [CodeComplete] Fix accessibility of protected members when accessing members… (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D53369?vs=169995&id=170377#to

[PATCH] D53489: [change-namespace] Enhance detection of conflicting namespaces.

2018-10-22 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: hokein. Herald added a subscriber: cfe-commits. For example: namespace util { class Base; } namespace new { namespace util { class Internal; } } namespace old { util::Base b1; } When changing `old::` to `new::`, `util::`

[PATCH] D53489: [change-namespace] Enhance detection of conflicting namespaces.

2018-10-22 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL344897: [change-namespace] Enhance detection of conflicting namespaces. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D53489

[PATCH] D53503: [clangd] Support URISchemes configuration in BackgroundIndex.

2018-10-22 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53503 Files: clangd/index/Background.cpp clangd/index/Background.h I

[PATCH] D53503: [clangd] Support URISchemes configuration in BackgroundIndex.

2018-10-22 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL344912: [clangd] Support URISchemes configuration in BackgroundIndex. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D53503

[PATCH] D53433: [clangd] auto-index stores symbols per-file instead of per-TU.

2018-10-22 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/FileIndex.h:49 +/// rename the existing FileSymbols to something else e.g. TUSymbols? +class SymbolsGroupedByFiles { +public: sammccall wrote: > `FileSymbols` isn't actually that opinionated about the data it

[PATCH] D53433: [clangd] *Prototype* auto-index stores symbols per-file instead of per-TU.

2018-10-22 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 170440. ioeric marked 2 inline comments as done. ioeric added a comment. - address review comments - minor cleanup Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53433 Files: clangd/index/Background.cpp clangd/index/Background.h clangd

[PATCH] D53433: [clangd] auto-index stores symbols per-file instead of per-TU.

2018-10-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 170664. ioeric marked 5 inline comments as done. ioeric added a comment. - address review comments - merged with origin/master - Cleanup Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53433 Files: clangd/index/Background.cpp clangd/index

[PATCH] D53433: [clangd] auto-index stores symbols per-file instead of per-TU.

2018-10-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/IndexAction.h:33 +std::function RefsCallback, +std::function FileDigestsCallback); sammccall wrote: > thinking about what we eventually want here: > - the index action needs to tell the auto-indexe

[PATCH] D53587: [clangd] Truncate SymbolID to 16 bytes.

2018-10-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. We should watch out for the downstream backward compatibility. Comment at: clangd/index/Index.h:92 // As USRs (Unified Symbol Resolution) could be large, especially for func

[PATCH] D53635: [CodeComplete] Expose InBaseClass signal in code completion results.

2018-10-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: ilya-biryukov. Herald added a subscriber: cfe-commits. No new tests as the existing tests for result priority should give us coverage. Also as the new flag is trivial enough, I'm reluctant to plumb the flag to c-index-test output. Repository

[PATCH] D53635: [CodeComplete] Expose InBaseClass signal in code completion results.

2018-10-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D53635#1273904, @ilya-biryukov wrote: > LG, but could we add a test for the new flag it by printing it in > `PrintingCodeCompleteConsumer::ProcessCodeCompleteResults()` and adding > corresponding tests to `clang/test/CodeCompletion`? > > Simil

[PATCH] D53635: [CodeComplete] Expose InBaseClass signal in code completion results.

2018-10-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 170838. ioeric added a comment. - Add tests for the new flag. Repository: rC Clang https://reviews.llvm.org/D53635 Files: include/clang/Sema/CodeCompleteConsumer.h lib/Sema/CodeCompleteConsumer.cpp lib/Sema/SemaCodeComplete.cpp test/CodeCompletion

[PATCH] D53638: [clangd] Downrank members from base class

2018-10-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: sammccall, ilya-biryukov. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay. ioeric added a dependency: D53635: [CodeComplete] Expose InBaseClass signal in code completion results.. Repository: rCTE Clang Tools Extr

[PATCH] D53635: [CodeComplete] Expose InBaseClass signal in code completion results.

2018-10-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 170854. ioeric marked an inline comment as done. ioeric added a comment. - move tags into case. Repository: rC Clang https://reviews.llvm.org/D53635 Files: include/clang/Sema/CodeCompleteConsumer.h lib/Sema/CodeCompleteConsumer.cpp lib/Sema/SemaCode

[PATCH] D53635: [CodeComplete] Expose InBaseClass signal in code completion results.

2018-10-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 170855. ioeric added a comment. - Rebase Repository: rC Clang https://reviews.llvm.org/D53635 Files: include/clang/Sema/CodeCompleteConsumer.h lib/Sema/CodeCompleteConsumer.cpp lib/Sema/SemaCodeComplete.cpp test/CodeCompletion/member-access.cpp

[PATCH] D53635: [CodeComplete] Expose InBaseClass signal in code completion results.

2018-10-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: lib/Sema/CodeCompleteConsumer.cpp:557 + if (!Tags.empty()) +OS << " (" << llvm::join(Tags, ",") << ")"; + if (CodeCompletionString *CCS = Results[I].CreateCodeCompletionString( ilya-biryukov wrote: > NIT

[PATCH] D53635: [CodeComplete] Expose InBaseClass signal in code completion results.

2018-10-24 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL345135: [CodeComplete] Expose InBaseClass signal in code completion results. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D

[PATCH] D53571: [clangd] Don't show base class versions of members as completions.

2018-10-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. > Keep required quailifier machinery around though, for cross-ns completion. Do we have cross-ns completion in sema? Comment at: clangd/CodeComplete.cpp:732 + // Class members that are shadowed by subclasses are usually noise. + if (Result.Hid

[PATCH] D53399: [clangd] Ensure that we reply to each call exactly once. NFC (I think!)

2018-10-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/ClangdLSPServer.cpp:112 +SPAN_ATTACH(Tracer, "Params", Params); +ReplyOnce Reply(ID, Method, &Server, Tracer.Args); log("<-- {0}({1})", Method, ID); Do we have guarantee that `Tracer.Args` outlives `Re

[PATCH] D53638: [clangd] Downrank members from base class

2018-10-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric marked an inline comment as done. ioeric added inline comments. Comment at: unittests/clangd/QualityTests.cpp:187 Relevance.merge(CodeCompletionResult(&findDecl(AST, "S::S"), 42)); - EXPECT_EQ(Relevance.Scope, SymbolRelevanceSignals::GlobalScope); } i

[PATCH] D53638: [clangd] Downrank members from base class

2018-10-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 170862. ioeric marked an inline comment as done. ioeric added a comment. - restore accidentally removed test. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53638 Files: clangd/Quality.cpp clangd/Quality.h unittests/clangd/QualityTests

[PATCH] D53571: [clangd] Don't show base class versions of members as completions.

2018-10-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. The diff seems to be wrong. Please rebase. Comment at: clangd/CodeComplete.cpp:732 + // Class members that are shadowed by subclasses are usually noise. + if (Resul

[PATCH] D53638: [clangd] Downrank members from base class

2018-10-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 170870. ioeric marked an inline comment as done. ioeric added a comment. - adjust parameter Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53638 Files: clangd/Quality.cpp clangd/Quality.h unittests/clangd/QualityTests.cpp Index: unit

[PATCH] D53638: [clangd] Downrank members from base class

2018-10-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/Quality.cpp:380 + if (InBaseClass) +Score *= 0.7; + sammccall wrote: > This seems like a pretty light penalty to me, I'd consider 0.5... 0.5 sounds reasonable. I think we should penalize the non-instance membe

[PATCH] D53638: [clangd] Downrank members from base class

2018-10-24 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL345140: [clangd] Downrank members from base class (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D53638 Files: clang-tools

[PATCH] D53433: [clangd] auto-index stores symbols per-file instead of per-TU.

2018-10-29 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 171467. ioeric added a comment. - minor cleanup and a friendly ping. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53433 Files: clangd/index/Background.cpp clangd/index/Background.h clangd/index/FileIndex.cpp clangd/index/FileIndex.

[PATCH] D53433: [clangd] auto-index stores symbols per-file instead of per-TU.

2018-10-30 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 171684. ioeric marked 11 inline comments as done. ioeric added a comment. - address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53433 Files: clangd/index/Background.cpp clangd/index/Background.h clangd/index/FileInd

[PATCH] D53433: [clangd] auto-index stores symbols per-file instead of per-TU.

2018-10-30 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/Background.cpp:311 SPAN_ATTACH(Tracer, "refs", int(Refs.numRefs())); - // FIXME: partition the symbols by file rather than TU, to avoid duplication. - IndexedSymbols.update(AbsolutePath, -llvm::ma

[PATCH] D53926: [clangd] Only add global scope to completion query scopes for TU context.

2018-10-31 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. This avoids duplicated scopes in the query e.g. when anonymous namespace is present. Repository: rCTE Clang Tools Extra https://review

[PATCH] D53433: [clangd] auto-index stores symbols per-file instead of per-TU.

2018-10-31 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 171901. ioeric marked 3 inline comments as done. ioeric added a comment. - Merged with multi-threading changes. Added mutex for file digests. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53433 Files: clangd/index/Background.cpp clangd/

[PATCH] D53433: [clangd] auto-index stores symbols per-file instead of per-TU.

2018-10-31 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Made some more changes to make the code work in multiple threads (add mutex for digests, take snapshot of digests for each run etc). PTAL Comment at: clangd/index/Background.cpp:311 SPAN_ATTACH(Tracer, "refs", int(Refs.numRefs())); - // FIXME: parti

[PATCH] D53933: [clangd] Get rid of QueryScopes.empty() == AnyScope special case.

2018-10-31 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53933 Files: clangd/FindSymbols.cpp clangd/index/Index.h clangd/inde

[PATCH] D56830: Prototype for include-fixer workflow in clangd. [NOT FOR REVIEW]

2019-01-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, javed.absar, ilya-biryukov. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D56830 Files: clangd/ClangdServer.cpp clangd/ClangdUnit.cpp clangd/ClangdUnit.h clangd/Dia

[PATCH] D56841: [clangd] Filter out plugin related flags.

2019-01-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/ClangdUnit.cpp:429 + const auto &CommandLine = Inputs.CompileCommand.CommandLine; + for (size_t I = 0, E = CommandLine.size(); I != E; I++) { +// According to https://clang.llvm.org/docs/ClangPlugins.html Thi

[PATCH] D56841: [clangd] Filter out plugin related flags.

2019-01-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/ClangdUnit.cpp:429 + const auto &CommandLine = Inputs.CompileCommand.CommandLine; + for (size_t I = 0, E = CommandLine.size(); I != E; I++) { +// According to https://clang.llvm.org/docs/ClangPlugins.html ily

[PATCH] D56903: [clangd] Suggest adding missing includes for incomplete type diagnostics.

2019-01-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, kadircet, arphaman, mgrang, jkorous, MaskRay, javed.absar, ilya-biryukov, mgorny. This enables clangd to intercept compiler diagnostics and attach fixes (e.g. by querying index). This patch ad

[PATCH] D56903: [clangd] Suggest adding missing includes for incomplete type diagnostics.

2019-01-21 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 182796. ioeric added a comment. - add comments Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56903/new/ https://reviews.llvm.org/D56903 Files: clangd/CMakeLists.txt clangd/ClangdServer.cpp clangd/ClangdUni

[PATCH] D57021: [clangd] Suggest adding missing includes for typos (like include-fixer).

2019-01-21 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. This adds include-fixer feature into clangd based on D56903 . Clangd now captures diagnostics caused by typos and attach include insertion fixes to potentially fix the typo. Repository: rCTE Cla

[PATCH] D57021: [clangd] Suggest adding missing includes for typos (like include-fixer).

2019-01-21 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 182799. ioeric added a comment. - revert unintended change Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57021/new/ https://reviews.llvm.org/D57021 Files: clangd/CMakeLists.txt clangd/ClangdServer.cpp clan

[PATCH] D57021: [clangd] Suggest adding missing includes for typos (like include-fixer).

2019-01-21 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 182800. ioeric added a comment. - Rebase on D56903 . Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57021/new/ https://reviews.llvm.org/D57021 Files: clangd/ClangdUnit.cpp cla

[PATCH] D57042: [clangd] NFC: reduce log noise from Diagnostics.

2019-01-22 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D57042 Files: clangd/Diagnostics.cpp Index: clangd/Diagnostics.cpp

[PATCH] D57047: [clangd] Fix broken build after r351793.

2019-01-22 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: kadircet, sammccall. Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay, ilya-biryukov. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D57047 Files: clangd/CodeComplete.cpp Index: clangd/CodeComplete.cpp ===

[PATCH] D57042: [clangd] NFC: reduce log noise from Diagnostics.

2019-01-22 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL351813: [clangd] NFC: reduce log noise from Diagnostics. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D57047: [clangd] Fix broken build after r351793.

2019-01-22 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In D57047#1366265 , @kadircet wrote: > LGTM, but hokein might know better whether to push the default options or the > one in ClangdServerOpts I'm going to land this now to unbreak build. Feel free to comment or do further refac

[PATCH] D57047: [clangd] Fix broken build after r351793.

2019-01-22 Thread Eric Liu via Phabricator via cfe-commits
ioeric abandoned this revision. ioeric added a comment. nvm, Simon beat me to it ;) Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57047/new/ https://reviews.llvm.org/D57047 ___ cfe-commits mailing list

[PATCH] D56903: [clangd] Suggest adding missing includes for incomplete type diagnostics.

2019-01-22 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In D56903#1365487 , @sammccall wrote: > This looks pretty good! My main concern is latency (and variability of > latency) in practice. > Particularly: > > - we should avoid paying for fuzzyfind and fetching hundreds of results when

[PATCH] D56903: [clangd] Suggest adding missing includes for incomplete type diagnostics.

2019-01-22 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 182922. ioeric marked 15 inline comments as done. ioeric added a comment. - Address review comments Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56903/new/ https://reviews.llvm.org/D56903 Files: clangd/CMakeL

[PATCH] D57021: [clangd] Suggest adding missing includes for typos (like include-fixer).

2019-01-22 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 182925. ioeric added a comment. - Rebase on D56903 Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57021/new/ https://reviews.llvm.org/D57021 Files: clangd/ClangdUnit.cpp clan

[PATCH] D57223: [Tooling] Handle #pragma once header guard in include insertion.

2019-01-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: ilya-biryukov. Herald added a subscriber: cfe-commits. Repository: rC Clang https://reviews.llvm.org/D57223 Files: lib/Tooling/Inclusions/HeaderIncludes.cpp unittests/Tooling/HeaderIncludesTest.cpp Index: unittests/Tooling/HeaderInclu

[PATCH] D56903: [clangd] Suggest adding missing includes for incomplete type diagnostics.

2019-01-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Friendly ping. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56903/new/ https://reviews.llvm.org/D56903 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[PATCH] D56903: [clangd] Suggest adding missing includes for incomplete type diagnostics.

2019-01-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 183507. ioeric added a comment. - minor touch on documentation. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56903/new/ https://reviews.llvm.org/D56903 Files: clangd/CMakeLists.txt clangd/ClangdServer.cpp

[PATCH] D56903: [clangd] Suggest adding missing includes for incomplete type diagnostics.

2019-01-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 183509. ioeric added a comment. - Rebase correctly Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56903/new/ https://reviews.llvm.org/D56903 Files: clangd/CMakeLists.txt clangd/ClangdServer.cpp clangd/Clang

[PATCH] D56903: [clangd] Suggest adding missing includes for incomplete type diagnostics.

2019-01-28 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 183838. ioeric marked 12 inline comments as done. ioeric added a comment. - address review comments Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56903/new/ https://reviews.llvm.org/D56903 Files: clangd/CMakeL

[PATCH] D56903: [clangd] Suggest adding missing includes for incomplete type diagnostics.

2019-01-28 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL352361: [clangd] Suggest adding missing includes for incomplete type diagnostics. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.l

[PATCH] D57021: [clangd] Suggest adding missing includes for typos (like include-fixer).

2019-01-28 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 183845. ioeric added a comment. - Rebase on origin/master Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57021/new/ https://reviews.llvm.org/D57021 Files: clangd/ClangdUnit.cpp clangd/IncludeFixer.cpp clang

[PATCH] D57223: [Tooling] Handle #pragma once header guard in include insertion.

2019-01-29 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 184076. ioeric marked an inline comment as done. ioeric added a comment. - fix typo Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57223/new/ https://reviews.llvm.org/D57223 Files: lib/Tooling/Inclusions/HeaderIncludes.cpp

[PATCH] D57223: [Tooling] Handle #pragma once header guard in include insertion.

2019-01-29 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL352503: [Tooling] Handle #pragma once header guard in include insertion. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACTION ht

[PATCH] D57442: [OpenGL] Fix test on PPC after r352540

2019-01-30 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: bkramer. Herald added a subscriber: Anastasia. Specify -triple like test/SemaOpenCL/logical-ops.cl. Otherwise, this test fails on PPC. Repository: rC Clang https://reviews.llvm.org/D57442 Files: test/SemaOpenCL/format-strings-fixit.cl

[PATCH] D57442: [OpenGL] Fix test on PPC after r352540

2019-01-30 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL352618: [OpenGL] Fix test on PPC after r352540 (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57

[PATCH] D57021: [clangd] Suggest adding missing includes for typos (like include-fixer).

2019-01-31 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Ping Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57021/new/ https://reviews.llvm.org/D57021 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[PATCH] D57509: [clangd] Append "(fix available)" to diagnostic message when fixes are present.

2019-01-31 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. This would make diagnostic fixits more discoverable, especially for plugins like YCM. Repository: rCTE Clang Tools Extra https://revie

[PATCH] D57509: [clangd] Append "(fix available)" to diagnostic message when fixes are present.

2019-01-31 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 184510. ioeric marked 2 inline comments as done. ioeric added a comment. - address comments Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57509/new/ https://reviews.llvm.org/D57509 Files: clangd/Diagnostics.cp

<    3   4   5   6   7   8   9   10   11   12   >