[PATCH] D47272: [clangd] Build index on preamble changes instead of the AST changes

2018-05-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Would it be possible to add some integration tests for file index plus preamble? Comment at: clangd/index/FileIndex.cpp:37 + std::vector TopLevelDecls( + AST.getTranslationUnitDecl()->decls().begin(), + AST.getTranslationUnitDecl()->decls().en

[PATCH] D47256: [clangd] Fix code completion in MACROs with stringification.

2018-05-24 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL333174: [clangd] Fix code completion in MACROs with stringification. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D47256 F

[PATCH] D47262: [VFS] Implement getRealPath in InMemoryFileSystem.

2018-05-24 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC333172: [VFS] Implement getRealPath in InMemoryFileSystem. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D47262?vs=148220&id=148376#toc Repository: rC Clang

[PATCH] D47262: [VFS] Implement getRealPath in InMemoryFileSystem.

2018-05-24 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL333172: [VFS] Implement getRealPath in InMemoryFileSystem. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D47262 Files: cf

[PATCH] D47262: [VFS] Implement getRealPath in InMemoryFileSystem.

2018-05-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: bkramer. Repository: rC Clang https://reviews.llvm.org/D47262 Files: include/clang/Basic/VirtualFileSystem.h lib/Basic/VirtualFileSystem.cpp unittests/Basic/VirtualFileSystemTest.cpp Index: unittests/Basic/VirtualFileSystemTest.cpp

[PATCH] D47187: [clangd] Skip .inc headers when canonicalizing header #include.

2018-05-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 148218. ioeric marked 3 inline comments as done. ioeric added a comment. - addressed comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D47187 Files: clangd/index/CanonicalIncludes.cpp clangd/index/CanonicalIncludes.h clangd/index

[PATCH] D47256: [clangd] Fix code completion in MACROs with stringification.

2018-05-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 148206. ioeric added a comment. - Fix broken test Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D47256 Files: clangd/CodeComplete.cpp unittests/clangd/CodeCompleteTests.cpp Index: unittests/clangd/CodeCompleteTests.cpp =

[PATCH] D47183: [clangd] Support multiple sema code completion callbacks.

2018-05-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric abandoned this revision. ioeric added a comment. Dropping this in favor of https://reviews.llvm.org/D47256 Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D47183 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://li

[PATCH] D47256: [clangd] Fix code completion in MACROs with stringification.

2018-05-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, jkorous, MaskRay, klimek. Currently, we only handle the first callback from sema code completion and ignore results from potential following callbacks. This causes causes loss of completion

[PATCH] D47187: [clangd] Skip .inc headers when canonicalizing header #include.

2018-05-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/SymbolCollector.cpp:209 + while (true) { +if (!Loc.isValid() || SM.isInMainFile(Loc)) + break; sammccall wrote: > (as above, maybe want to include the main file for simplicity/symmetry) Thanks! As y

[PATCH] D47187: [clangd] Skip .inc headers when canonicalizing header #include.

2018-05-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 148189. ioeric marked 4 inline comments as done. ioeric added a comment. - Include main file in the include stack when mapping headers. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D47187 Files: clangd/index/CanonicalIncludes.cpp clangd

[PATCH] D46943: [clangd] Boost scores for decls from current file in completion

2018-05-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D46943#1107880, @ilya-biryukov wrote: > I've added an initial version of testing for the matching header and wanted > to get feedback before proceeding further with tests and other changes. > > A few things that bug me so far: > > - We need to

[PATCH] D47065: [clangd] Enable parsing of non-doxygen comments in global-symbol-builder

2018-05-22 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 Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D47065 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.l

[PATCH] D47183: [clangd] Support multiple sema code completion callbacks.

2018-05-22 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. OK, it turned out that there are a few things that I overlooked: 1. Top-N Ranking would be broken among different callbacks. We would need to keep a single `TopN` for all callbacks. 2. Due to 1), materialization of TopN candidates would happen after all callbacks have fi

[PATCH] D47066: [clangd] Remove ignored Preamble::CanReuse call from completion

2018-05-22 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 Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D47066 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.l

[PATCH] D47183: [clangd] Support multiple sema code completion callbacks.

2018-05-22 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/CodeComplete.cpp:457 Result.StartsNestedNameSpecifier = false; + // FIXME: the same result can be added multiple times as the callback can + // be called more than once. We may want to deduplicate identical result

[PATCH] D47187: [clangd] Skip .inc headers when canonicalizing header #include.

2018-05-22 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, jkorous, MaskRay, ilya-biryukov, klimek. This assumes that .inc files are supposed to be included via headers that include them. Repository: rCTE Clang Tools Extra https://reviews.llvm.org

[PATCH] D47183: [clangd] Support multiple sema code completion callbacks.

2018-05-22 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: ilya-biryukov, sammccall. Herald added subscribers: cfe-commits, jkorous, MaskRay, klimek. Currently, we only handle the first callback from sema code completion and ignore results from potential following callbacks. This causes causes loss of

[PATCH] D47068: Move #include manipulation code to new lib/Tooling/Inclusions.

2018-05-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric reopened this revision. ioeric added a comment. This revision is now accepted and ready to land. This was reverted in r332751 due to build bot failure with module config. I don't see how this failed as the directory setup is very similar to Tooling/Core/. Will investigate further next wee

[PATCH] D47065: [clangd] Enable parsing of non-doxygen comments in global-symbol-builder

2018-05-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Should we also change the behavior in dynamic index? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D47065 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo

[PATCH] D47074: [Tooling] Add an overload of runToolOnCodeWithArgs that takes VFS

2018-05-18 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC332731: [Tooling] Add an overload of runToolOnCodeWithArgs that takes VFS (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D47074?vs=147526&id=147529#toc Repositor

[PATCH] D47074: [Tooling] Add an overload of runToolOnCodeWithArgs that takes VFS

2018-05-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: bkramer. Herald added subscribers: cfe-commits, klimek. ... to support purely VFS-based tools. Repository: rC Clang https://reviews.llvm.org/D47074 Files: include/clang/Tooling/Tooling.h lib/Tooling/Tooling.cpp Index: lib/Tooling/T

[PATCH] D47068: Move #include manipulation code to new lib/Tooling/Inclusions.

2018-05-18 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. ioeric marked an inline comment as done. Closed by commit rL332720: Move #include manipulation code to new lib/Tooling/Inclusions. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Changed prior

[PATCH] D47068: Move #include manipulation code to new lib/Tooling/Inclusions.

2018-05-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric marked an inline comment as done. ioeric added inline comments. Comment at: include/clang/Format/Format.h:20 #include "clang/Tooling/Core/Replacement.h" +#include "clang/Tooling/Inclusions/IncludeStyle.h" #include "llvm/ADT/ArrayRef.h" ilya-biryukov wrot

[PATCH] D47068: Move #include manipulation code to new lib/Tooling/Inclusions.

2018-05-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, mgorny, klimek. clangToolingCore is linked into almost everything (incl. clang), but not few tools need #include manipulation at this point. So pull this into a separate library in Tooling.

[PATCH] D47060: [VFS] Implement getRealPath for OverlayFileSystem.

2018-05-18 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL332717: [VFS] Implement getRealPath for OverlayFileSystem. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D47060 Files: cf

[PATCH] D47060: [VFS] Implement getRealPath for OverlayFileSystem.

2018-05-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 147491. ioeric marked an inline comment as done. ioeric added a comment. - Add and use const_iterator. Repository: rC Clang https://reviews.llvm.org/D47060 Files: include/clang/Basic/VirtualFileSystem.h lib/Basic/VirtualFileSystem.cpp unittests/Basi

[PATCH] D47060: [VFS] Implement getRealPath for OverlayFileSystem.

2018-05-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 147488. ioeric added a comment. Fix test... Repository: rC Clang https://reviews.llvm.org/D47060 Files: include/clang/Basic/VirtualFileSystem.h lib/Basic/VirtualFileSystem.cpp unittests/Basic/VirtualFileSystemTest.cpp Index: unittests/Basic/Virtua

[PATCH] D47060: [VFS] Implement getRealPath for OverlayFileSystem.

2018-05-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 147487. ioeric added a comment. Minor cleanup Repository: rC Clang https://reviews.llvm.org/D47060 Files: include/clang/Basic/VirtualFileSystem.h lib/Basic/VirtualFileSystem.cpp unittests/Basic/VirtualFileSystemTest.cpp Index: unittests/Basic/Virt

[PATCH] D47060: [VFS] Implement getRealPath for OverlayFileSystem.

2018-05-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: bkramer. Herald added a subscriber: cfe-commits. Repository: rC Clang https://reviews.llvm.org/D47060 Files: include/clang/Basic/VirtualFileSystem.h lib/Basic/VirtualFileSystem.cpp unittests/Basic/VirtualFileSystemTest.cpp Index: u

[PATCH] D44954: [clangd] Add "member" symbols to the index

2018-05-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. > It's also for textDocument/documentSymbol. For this, we technically don't > need them in the static index since we could collect symbols when the > document is opened, but we also want them for workspaceSymbols so we might as > well use the same symbol collector, etc.

[PATCH] D44954: [clangd] Add "member" symbols to the index

2018-05-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/SymbolCollector.cpp:113 - // We only want: - // * symbols in namespaces or translation unit scopes (e.g. no class - // members) - // * enum constants in unscoped enum decl (e.g. "red" in "enum {red};") - auto I

[PATCH] D46943: [clangd] Boost scores for decls from current file in completion

2018-05-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/Quality.cpp:24 + if (SemaCCResult.Declaration) +AllDeclsInMainFile = allDeclsInMainFile(SemaCCResult.Declaration); if (SemaCCResult.Availability == CXAvailability_Deprecated) ioeric wrote: > ilya-biryukov w

[PATCH] D46943: [clangd] Boost scores for decls from current file in completion

2018-05-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/Quality.cpp:24 + if (SemaCCResult.Declaration) +AllDeclsInMainFile = allDeclsInMainFile(SemaCCResult.Declaration); if (SemaCCResult.Availability == CXAvailability_Deprecated) ilya-biryukov wrote: > sammccal

[PATCH] D44954: [clangd] Add "member" symbols to the index

2018-05-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D44954#1101922, @malaperle wrote: > @ioeric You mentioned in https://reviews.llvm.org/D46751 that it would make > sense to add a flag to disable indexing members. Could you comment on that? > What kind of granularity were you thinking? Would a

[PATCH] D46942: Add vfs::FileSystem::getRealPath

2018-05-17 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL332590: Add vfs::FileSystem::getRealPath (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D46942 Files: cfe/trunk/include/cl

[PATCH] D43424: [clang-doc] Implement a (simple) Markdown generator

2018-05-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-doc/generators/Generators.h:44 +class MDGenerator : public Generator { +public: Could you add high-level comment on what this does? This seems to build up some directory structure and write different infos into d

[PATCH] D46942: Add vfs::FileSystem::getRealPath

2018-05-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: lib/Basic/FileManager.cpp:537 -#ifdef LLVM_ON_UNIX - char CanonicalNameBuf[PATH_MAX]; - if (realpath(Dir->getName().str().c_str(), CanonicalNameBuf)) + SmallString CanonicalNameBuf; + if (!FS->getRealPath(Dir->getName(), CanonicalNa

[PATCH] D46942: Add vfs::FileSystem::getRealPath

2018-05-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 147278. ioeric marked an inline comment as done. ioeric added a comment. - s/PATH_MAX/4096/ Repository: rC Clang https://reviews.llvm.org/D46942 Files: include/clang/Basic/VirtualFileSystem.h lib/Basic/FileManager.cpp lib/Basic/VirtualFileSystem.cpp

[PATCH] D43667: [clang-doc] Implement a YAML generator

2018-05-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-doc/Representation.h:238 + // Non-const accessors for YAML output. + std::vector &getNamespaceInfos() { return NamespaceInfos; } There are two alternatives to avoid this: 1) Pull the info storage into a separate

[PATCH] D46942: Add vfs::FileSystem::getRealPath

2018-05-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 147167. ioeric added a comment. - Add vfs::FileSystem::getRealPath; change getCanonicalName to use getRealPath Repository: rC Clang https://reviews.llvm.org/D46942 Files: include/clang/Basic/VirtualFileSystem.h lib/Basic/FileManager.cpp lib/Basic/Vi

[PATCH] D46943: [clangd] Boost scores for decls from current file in completion

2018-05-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/Quality.cpp:24 + if (SemaCCResult.Declaration) +AllDeclsInMainFile = allDeclsInMainFile(SemaCCResult.Declaration); if (SemaCCResult.Availability == CXAvailability_Deprecated) Could you explain why `AllDecls

[PATCH] D46942: Make sure getCanonicalName returns absolute paths even on VFS.

2018-05-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: bkramer. Herald added a subscriber: cfe-commits. Generally, canonical paths are expected to be absolute. This is the behavior for Windows build. But for unix, it might return relative paths when failing to resolve real path (e.g. unsupported s

[PATCH] D46751: [clangd] Filter out private proto symbols in SymbolCollector.

2018-05-16 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL332456: [clangd] Filter out private proto symbols in SymbolCollector. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D46751

[PATCH] D46751: [clangd] Filter out private proto symbols in SymbolCollector.

2018-05-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 147058. ioeric marked 3 inline comments as done. ioeric added a comment. - Merge remote-tracking branch 'origin/master' into proto - Addressed review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46751 Files: clangd/index/Symbol

[PATCH] D46751: [clangd] Filter out private proto symbols in SymbolCollector.

2018-05-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. > ...I hadn't noticed the latest version. I think it's safe enough in the new > version that we don't need to discuss this much further until it becomes a > bigger problem (more libraries, etc). Sounds good, thanks! @ilya-biryukov Could you take another look at the patc

[PATCH] D46751: [clangd] Filter out private proto symbols in SymbolCollector.

2018-05-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 147032. ioeric marked an inline comment as done. ioeric added a comment. - Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46751 Files: clangd/ClangdLSPServer.cpp clangd/SourceCode.cpp clangd/SourceCode.h clan

[PATCH] D46751: [clangd] Filter out private proto symbols in SymbolCollector.

2018-05-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/SymbolCollector.cpp:101 +// we check whether it starts with PROTO_HEADER_COMMENT. +bool isPrivateProtoSymbol(const NamedDecl &ND) { + const auto &SM = ND.getASTContext().getSourceManager(); sammccall wrote:

[PATCH] D46906: [clangd] Fix a link failure in unittests

2018-05-16 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 Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46906 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.l

[PATCH] D46497: [clangd] Populate #include insertions as additional edits in completion items.

2018-05-15 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE332363: [clangd] Populate #include insertions as additional edits in completion items. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D46497?vs=146843&id=146844

[PATCH] D46497: [clangd] Populate #include insertions as additional edits in completion items.

2018-05-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146843. ioeric added a comment. - Merged with origin/master Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46497 Files: clangd/ClangdServer.cpp clangd/CodeComplete.cpp clangd/CodeComplete.h clangd/Headers.cpp clangd/Headers.h cla

[PATCH] D46676: [clangd] Remove LSP command-based #include insertion.

2018-05-15 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. ioeric marked an inline comment as done. Closed by commit rL332362: [clangd] Remove LSP command-based #include insertion. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM

[PATCH] D46497: [clangd] Populate #include insertions as additional edits in completion items.

2018-05-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146839. ioeric added a comment. - Rebase... Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46497 Files: clangd/ClangdServer.cpp clangd/CodeComplete.cpp clangd/CodeComplete.h clangd/Headers.cpp clangd/Headers.h clangd/Protocol.h

[PATCH] D46497: [clangd] Populate #include insertions as additional edits in completion items.

2018-05-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146838. ioeric added a comment. - Rebase on https://reviews.llvm.org/D46676 Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46497 Files: clangd/ClangdLSPServer.cpp clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/CodeComplete.cpp

[PATCH] D46497: [clangd] Populate #include insertions as additional edits in completion items.

2018-05-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146834. ioeric marked 4 inline comments as done. ioeric added a comment. - Addressed review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46497 Files: clangd/ClangdLSPServer.cpp clangd/ClangdServer.cpp clangd/ClangdServer.h

[PATCH] D46751: [clangd] Filter out private proto symbols in SymbolCollector.

2018-05-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D46751#1099479, @malaperle wrote: > In https://reviews.llvm.org/D46751#1099097, @ioeric wrote: > > > > I think this is good if that's true that the comment is always there. I > > > think it would be OK for this to be enabled by default, with a

[PATCH] D46751: [clangd] Filter out private proto symbols in SymbolCollector.

2018-05-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. > I think this is good if that's true that the comment is always there. I think > it would be OK for this to be enabled by default, with a general option to > turn heuristics off. Not sure what to call it... > -use-symbol-filtering-heuristics :) @malaperle Having an opt

[PATCH] D46751: [clangd] Filter out private proto symbols in SymbolCollector.

2018-05-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146770. ioeric added a comment. - Add heuristic to reduce false position on identifying proto headers Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46751 Files: clangd/ClangdLSPServer.cpp clangd/SourceCode.cpp clangd/SourceCode.h cl

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-05-15 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: include/clang/AST/RawCommentList.h:138 + /// the overload with ASTContext in the rest of the code. + std::string getFormattedText(const SourceManager &Sour

[PATCH] D46497: [clangd] Populate #include insertions as additional edits in completion items.

2018-05-14 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146675. ioeric marked 7 inline comments as done. ioeric added a comment. - Addressed review comments. - Merged with origin/master Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46497 Files: clangd/ClangdServer.cpp clangd/CodeComplete.cpp

[PATCH] D46496: [Tooling] Pull #include manipulation code from clangFormat into libToolingCore.

2018-05-14 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL332287: [Tooling] Pull #include manipulation code from clangFormat into libToolingCore. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews

[PATCH] D46496: [Tooling] Pull #include manipulation code from clangFormat into libToolingCore.

2018-05-14 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 14. ioeric added a comment. - Merged with origin/master - Make copy instead of taking references to ensure lifetime. Repository: rC Clang https://reviews.llvm.org/D46496 Files: include/clang/Format/Format.h include/clang/Tooling/Core/HeaderInclude

[PATCH] D46758: [clang-format] Move #include related style to libToolingCore

2018-05-14 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL332284: [clang-format] Move #include related style to libToolingCore (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D46758 F

[PATCH] D46758: [clang-format] Move #include related style to libToolingCore

2018-05-14 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146598. ioeric marked an inline comment as done. ioeric added a comment. - Remove an unintended change. Repository: rC Clang https://reviews.llvm.org/D46758 Files: include/clang/Format/Format.h include/clang/Tooling/Core/IncludeStyle.h lib/Format/Fo

[PATCH] D46758: [clang-format] Move #include related style to libToolingCore

2018-05-14 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: lib/Format/Format.cpp:2277 auto Replace = -Includes.insert(trimInclude(IncludeName), IncludeName.startswith("<")); +Includes.insert(IncludeName.trim("\"<>"), IncludeName.startswith("<")); if (Replace) { -

[PATCH] D46675: [clangd] Add helper for collecting #include directives in file.

2018-05-14 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE332237: [clangd] Add helper for collecting #include directives in file. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D46675?vs=146581&id=146583#toc Repositor

[PATCH] D46675: [clangd] Add helper for collecting #include directives in file.

2018-05-14 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146581. ioeric marked an inline comment as done. ioeric added a comment. - Merged with origin/master - Addressed review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46675 Files: clangd/ClangdUnit.cpp clangd/ClangdUnit.h cla

[PATCH] D46496: [Tooling] Pull #include manipulation code from clangFormat into libToolingCore.

2018-05-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146393. ioeric added a comment. - Rebase on https://reviews.llvm.org/D46758 Repository: rC Clang https://reviews.llvm.org/D46496 Files: include/clang/Format/Format.h include/clang/Tooling/Core/HeaderIncludes.h lib/Format/Format.cpp lib/Tooling/Cor

[PATCH] D46758: [clang-format] Move #include related style to libToolingCore

2018-05-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146390. ioeric marked an inline comment as done. ioeric added a comment. Herald added a subscriber: mgorny. - also moved yaml traits. Repository: rC Clang https://reviews.llvm.org/D46758 Files: include/clang/Format/Format.h include/clang/Tooling/Core/

[PATCH] D46496: [Tooling] Pull #include manipulation code from clangFormat into libToolingCore.

2018-05-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146385. ioeric added a comment. - Revert commit on wrong branch. Repository: rC Clang https://reviews.llvm.org/D46496 Files: include/clang/Format/Format.h include/clang/Tooling/Core/HeaderIncludes.h include/clang/Tooling/Core/IncludeStyle.h lib/Fo

[PATCH] D46496: [Tooling] Pull #include manipulation code from clangFormat into libToolingCore.

2018-05-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146384. ioeric added a comment. - Also moved yaml traits. Repository: rC Clang https://reviews.llvm.org/D46496 Files: include/clang/Format/Format.h include/clang/Tooling/Core/HeaderIncludes.h include/clang/Tooling/Core/IncludeStyle.h lib/Format/Fo

[PATCH] D46496: [Tooling] Pull #include manipulation code from clangFormat into libToolingCore.

2018-05-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. The moving of IncludeStyle has been split into a separate patch https://reviews.llvm.org/D46758. Comment at: include/clang/Format/Format.h:1818 /// from \p Code if it exists. +/// See documentation for `tooling::HeaderIncludes` for the behavior. llv

[PATCH] D46496: [Tooling] Pull #include manipulation code from clangFormat into libToolingCore.

2018-05-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146339. ioeric marked 3 inline comments as done. ioeric added a comment. - Rebase on https://reviews.llvm.org/D46758 - Addressed comments. Repository: rC Clang https://reviews.llvm.org/D46496 Files: include/clang/Format/Format.h include/clang/Tooling/

[PATCH] D46751: [clangd] Filter out private proto symbols in SymbolCollector.

2018-05-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Thanks for sharing the example Marc! It's a bit surprising to see files that are not protobuf-generated named proto.h. I'm not a big fan of parsing file comment in proto. It seems a bit cumbersome and we might not be able (or too expensive) to do so for completion result

[PATCH] D46751: [clangd] Filter out private proto symbols in SymbolCollector.

2018-05-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146338. ioeric marked 3 inline comments as done. ioeric added a comment. - Addressed a few comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46751 Files: clangd/index/SymbolCollector.cpp unittests/clangd/SymbolCollectorTests.cpp

[PATCH] D46758: [clang-format] Move #include related style to libToolingCore

2018-05-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, klimek. This will be shared by include insertion/deletion library. Repository: rC Clang https://reviews.llvm.org/D46758 Files: include/clang/Format/Format.h include/clang/Tooling/

[PATCH] D46676: [clangd] Remove LSP command-based #include insertion.

2018-05-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric marked an inline comment as done. ioeric added inline comments. Comment at: unittests/clangd/ClangdTests.cpp:941 -TEST_F(ClangdVFSTest, InsertIncludes) { - MockFSProvider FS; ilya-biryukov wrote: > Do we test the same thing somewhere else (e.g. code co

[PATCH] D46751: [clangd] Filter out private proto symbols in SymbolCollector.

2018-05-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, jkorous, MaskRay, klimek. This uses heuristics to identify private proto symbols. For example, top-level symbols whose name contains "_" are considered private. These symbols are not expect

[PATCH] D46670: [clangd] Move helpers that convert Replacements to TextEdits to SourceCode.h

2018-05-11 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL332089: [clangd] Move helpers that convert Replacements to TextEdits to SourceCode.h (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.ll

[PATCH] D46670: [clangd] Move helpers that convert Replacements to TextEdits to SourceCode.h

2018-05-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/SourceCode.h:62 +std::vector +replacementsToEdits(StringRef Code, +const std::vector &Replacements); ilya-biryukov wrote: > Do we really need to expose separate functions for > `vector` and `to

[PATCH] D46670: [clangd] Move helpers that convert Replacements to TextEdits to SourceCode.h

2018-05-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146303. ioeric marked 2 inline comments as done. ioeric added a comment. - Got rid of a helper for std::vector Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46670 Files: clangd/ClangdLSPServer.cpp clangd/SourceCode.cpp clangd/SourceCo

[PATCH] D46676: [clangd] Remove LSP command-based #include insertion.

2018-05-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D46676#1095713, @ilya-biryukov wrote: > This LG, but we should first roll out the `additionalEdits` change. > Aren't the dependencies reversed in the dependency stack, i.e. this change > should be the last one? You are right ;) I got the dep

[PATCH] D46497: [clangd] Populate #include insertions as additional edits in completion items.

2018-05-10 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. This has been split and now depends on https://reviews.llvm.org/D46670, https://reviews.llvm.org/D46675, https://reviews.llvm.org/D46676. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46497 ___ cfe-commits

[PATCH] D46497: [clangd] Populate #include insertions as additional edits in completion items.

2018-05-10 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146083. ioeric added a comment. - Rebase on https://reviews.llvm.org/D46670, https://reviews.llvm.org/D46675, https://reviews.llvm.org/D46676 Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46497 Files: clangd/ClangdServer.cpp clangd/Cod

[PATCH] D46670: [clangd] Move helpers that convert Replacements to TextEdits to SourceCode.h

2018-05-10 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146082. ioeric added a comment. - [clangd] Add helper for collecting #include directives in file. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46670 Files: clangd/ClangdLSPServer.cpp clangd/SourceCode.cpp clangd/SourceCode.h Index:

[PATCH] D46676: [clangd] Remove LSP command-based #include insertion.

2018-05-10 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: ilya-biryukov, sammccall. Herald added subscribers: cfe-commits, jkorous, MaskRay, klimek. clangd will populate #include insertions as addtionalEdits in completion items. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46676

[PATCH] D46675: [clangd] Add helper for collecting #include directives in file.

2018-05-10 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146075. ioeric added a comment. - Unmerge https://reviews.llvm.org/D46670 Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46675 Files: clangd/ClangdUnit.cpp clangd/ClangdUnit.h clangd/Headers.cpp clangd/Headers.h clangd/XRefs.cpp I

[PATCH] D46675: [clangd] Add helper for collecting #include directives in file.

2018-05-10 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146074. ioeric added a comment. - Rebase on origin/master Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46675 Files: clangd/ClangdLSPServer.cpp clangd/ClangdUnit.cpp clangd/ClangdUnit.h clangd/Headers.cpp clangd/Headers.h clangd

[PATCH] D46675: [clangd] Add helper for collecting #include directives in file.

2018-05-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, jkorous, MaskRay, ilya-biryukov, klimek. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46675 Files: clangd/ClangdUnit.cpp clangd/ClangdUnit.h clangd/Headers.cpp clang

[PATCH] D46670: [clangd] Move helpers that convert Replacements to TextEdits to SourceCode.h

2018-05-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, jkorous, MaskRay, klimek. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46670 Files: clangd/ClangdLSPServer.cpp clangd/SourceCode.cpp clangd/SourceCode.h Index: c

[PATCH] D46497: [clangd] Populate #include insertions as additional edits in completion items.

2018-05-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146046. ioeric added a comment. - Minor cleanup Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46497 Files: clangd/ClangdLSPServer.cpp clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/ClangdUnit.cpp clangd/ClangdUnit.h clangd

[PATCH] D46497: [clangd] Populate #include insertions as additional edits in completion items.

2018-05-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D46497#1089755, @sammccall wrote: > I'm concerned about the scope of this patch - it does too many things and > touches too many files for me to feel comfortable that I understand it well > enough to review. > Is it possible to split it up? (

[PATCH] D46497: [clangd] Populate #include insertions as additional edits in completion items.

2018-05-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146045. ioeric marked 15 inline comments as done. ioeric added a comment. - Merged with origin/master - Address review comments. - Revert unintended change. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46497 Files: clangd/ClangdLSPServer

[PATCH] D46496: [Tooling] Pull #include manipulation code from clangFormat into libToolingCore.

2018-05-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146042. ioeric added a comment. - Merged with origin/master Repository: rC Clang https://reviews.llvm.org/D46496 Files: include/clang/Format/Format.h include/clang/Tooling/Core/HeaderIncludes.h lib/Format/Format.cpp lib/Tooling/Core/CMakeLists.txt

[PATCH] D46496: [Tooling] Pull #include manipulation code from clangFormat into libToolingCore.

2018-05-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146012. ioeric added a comment. - Merged with origin/master Repository: rC Clang https://reviews.llvm.org/D46496 Files: include/clang/Format/Format.h include/clang/Tooling/Core/HeaderIncludes.h lib/Format/Format.cpp lib/Tooling/Core/CMakeLists.txt

[PATCH] D46176: Add SourceManagerForFile helper which sets up SourceManager and dependencies for a single file with code snippet

2018-05-09 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL331923: Add SourceManagerForFile helper which sets up SourceManager and dependencies… (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.l

[PATCH] D46176: Add SourceManagerForFile helper which sets up SourceManager and dependencies for a single file with code snippet

2018-05-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 146004. ioeric marked 4 inline comments as done. ioeric added a comment. - address review comments. Repository: rC Clang https://reviews.llvm.org/D46176 Files: include/clang/Basic/SourceManager.h lib/Basic/SourceManager.cpp lib/Format/Format.cpp l

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-05-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Thanks for adding the tests! Comment at: include/clang/AST/RawCommentList.h:138 + /// the overload with ASTContext in the rest of the code. + std::string getFormattedText(const SourceManager &SourceMgr, + DiagnosticsEngine

[PATCH] D46176: Add SourceManagerForFile helper which sets up SourceManager and dependencies for a single file with code snippet

2018-05-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 145386. ioeric added a comment. - Replaced forward decl of DiagnosticsEngine with header include. Repository: rC Clang https://reviews.llvm.org/D46176 Files: include/clang/Basic/SourceManager.h lib/Basic/SourceManager.cpp lib/Format/Format.cpp lib

[PATCH] D46497: [clangd] Populate #include insertions as additional edits in completion items.

2018-05-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, jkorous, MaskRay, ilya-biryukov, klimek. o Remove IncludeInsertion LSP command. o Populate include insertion edits synchromously in completion items. o Share the code completion compiler instan

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