[PATCH] D59885: [Lex] Allow to consume tokens while preprocessing

2019-05-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 11. ilya-biryukov added a comment. - Fix compilation of a clang-tidy check, add a FIXME to stop reporting those tokens Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59885/new/ https://reviews.llvm.or

[PATCH] D61774: [LibTooling] Add RangeSelector library for defining source ranges based on bound AST nodes.

2019-05-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov marked an inline comment as done. ilya-biryukov added inline comments. Comment at: clang/include/clang/Tooling/Refactoring/RangeSelector.h:29 + +namespace range_selector { +inline RangeSelector charRange(CharSourceRange R) { ymandel wrote: > ilya-bi

[PATCH] D61335: [LibTooling] Add support to Transformer for composing rules as an ordered choice.

2019-05-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang/include/clang/Tooling/Refactoring/Transformer.h:278 +/// Builds the matcher needed for registration. +ast_matchers::internal::DynTypedMatcher buildMatcher(const RewriteRule &Rule); + ymandel wrote: > ilya-bir

[PATCH] D41005: Reuse preamble even if an unsaved file does not exist

2019-05-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. Thanks! LGTM Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D41005/new/ https://reviews.llvm.org/D41005

[PATCH] D59887: [Syntax] Introduce TokenBuffer, start clangToolingSyntax library

2019-05-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 200019. ilya-biryukov added a comment. - Remove the function that maps tokens to offsets Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59887/new/ https://reviews.llvm.org/D59887 Files: clang/include/cl

[PATCH] D59887: [Syntax] Introduce TokenBuffer, start clangToolingSyntax library

2019-05-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 200030. ilya-biryukov added a comment. - Skip annotation tokens, some of them are reported by the preprocessor but we don't want them in the final expanded stream. - Add functions to compute FileRange of tokens, add tests for it. Repository: rG LLVM

[PATCH] D59887: [Syntax] Introduce TokenBuffer, start clangToolingSyntax library

2019-05-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang/include/clang/Tooling/Syntax/Tokens.h:115 + /// expansion. + llvm::Optional range(const SourceManager &SM) const; + sammccall wrote: > I think this might need a more explicit name. It's reasonably obvious t

[PATCH] D59887: [Syntax] Introduce TokenBuffer, start clangToolingSyntax library

2019-05-20 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 200213. ilya-biryukov marked 3 inline comments as done. ilya-biryukov added a comment. - Fix a comment, reformat - Use assertions instead of returning optionals Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D59887: [Syntax] Introduce TokenBuffer, start clangToolingSyntax library

2019-05-20 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang/include/clang/Tooling/Syntax/Tokens.h:115 + /// expansion. + llvm::Optional range(const SourceManager &SM) const; + sammccall wrote: > ilya-biryukov wrote: > > sammccall wrote: > > > I think this might need

[PATCH] D62137: [Frontend] Return an error on bad inputs to PrecompiledPreabmle

2019-05-20 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: sammccall. Herald added a project: clang. Instead of failing with assertions. Fixed a crash found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12865 Repository: rG LLVM Github Monorepo https://reviews.l

[PATCH] D61774: [LibTooling] Add RangeSelector library for defining source ranges based on bound AST nodes.

2019-05-20 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. Thanks! LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61774/new/ https://reviews.llvm.org/D61774

[PATCH] D62143: [clangd] Make it possible to use VFS from parsing for getting tidy options

2019-05-20 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: sammccall. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. To give an option for clangd embedders with snapshotted filesystem to read config files from exact snapshots, possibly loos

[PATCH] D62149: [LibTooling] Update Transformer to use RangeSelector instead of NodePart enum.

2019-05-20 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Looks neat! The only concern I have is about the growing number of overloads in `Transformer.h`, see the relevant comment. Comment at: clang/include/clang/Tooling/Refactoring/Transformer.h:186 +/// where a \c TextGenerator, \c RangeSelector are o

[PATCH] D62150: Renamed `apply` to `select` to avoid ADL conflict with `std::apply`

2019-05-20 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. Quick LGTM to unbreak our integrate! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62150/new/ https://reviews.llvm.org/D62150 _

[PATCH] D62150: Renamed `apply` to `select` to avoid ADL conflict with `std::apply`

2019-05-20 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. @ymandel, feel free to change the name to your liking if you don't like `select`. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62150/new/ https://reviews.llvm.org/D62150 ___ cfe-commi

[PATCH] D62143: [clangd] Make it possible to use VFS from parsing for getting tidy options

2019-05-20 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 200328. ilya-biryukov added a comment. - Add a typedef for function - Make the provider thread-safe Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62143/new/ https://reviews.llvm.org/D62143 Files: clang

[PATCH] D62143: [clangd] Make it possible to use VFS from parsing for getting tidy options

2019-05-20 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 200329. ilya-biryukov added a comment. - Fix a typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62143/new/ https://reviews.llvm.org/D62143 Files: clang-tools-extra/clangd/ClangdServer.cpp clang-too

[PATCH] D62143: [clangd] Make it possible to use VFS from parsing for getting tidy options

2019-05-20 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 200330. ilya-biryukov added a comment. - Fix another typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62143/new/ https://reviews.llvm.org/D62143 Files: clang-tools-extra/clangd/ClangdServer.cpp cla

[PATCH] D62151: [clangd] Add tweak to convert normal to raw string literal, when it contains escapes.

2019-05-21 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62151/new/ https://reviews.llvm.org/D62151 __

[PATCH] D59887: [Syntax] Introduce TokenBuffer, start clangToolingSyntax library

2019-05-21 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In D59887#1508991 , @thakis wrote: > Out of interest: The RecursiveASTVisitorTests are part of the ToolingTests > binary while this adds a new binary TokensTest. Can you say why? > > (No change needed, just curious.) The s

[PATCH] D61637: [Syntax] Introduce syntax trees

2019-05-21 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang/include/clang/Tooling/Syntax/Corpus.h:38 + std::pair> + tokenizeBuffer(std::unique_ptr Buffer); + sammccall wrote: > ilya-biryukov wrote: > > sammccall wrote: > > > Are you planning to have a way to add tok

[PATCH] D62187: Delete default constructors, copy constructors, move constructors, copy assignment, move assignment operators on Expr, Stmt and Decl

2019-05-22 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM Comment at: clang/include/clang/AST/DeclBase.h:374 + Decl(const Decl&) = delete; + Decl(Decl &&) = delete; + Decl &operator=(const Decl&) = delete;

[PATCH] D61386: [clang-tidy] Add support writing a check as a Transformer rewrite rule.

2019-05-22 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp:46 + + StringRef Message = "no explanation"; + if (Case.Explanation) { The users will see this for every case without explanation, right? I'd expec

[PATCH] D62238: [CodeComplete] Complete a lambda when preferred type is a function

2019-05-22 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: kadircet. Herald added a project: clang. Uses a heuristic to detect std::function and friends. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D62238 Files: clang/lib/Sema/SemaCodeComplete.cpp clang/test/Co

[PATCH] D62187: Delete default constructors, copy constructors, move constructors, copy assignment, move assignment operators on Expr, Stmt and Decl

2019-05-22 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. LG either way, the comments were NITs. Comment at: clang/include/clang/AST/Stmt.h:1057 + Stmt() = delete; Stmt(const Stmt &) = delete; gribozavr wrote: > ilya-biryukov wrote: > > NIT: Move the deleted declarations to the sta

[PATCH] D62149: [LibTooling] Update Transformer to use RangeSelector instead of NodePart enum.

2019-05-22 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov marked an inline comment as done. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM. See the nit about the comment, might be a good idea to fix it before landing. Comment at: clang/include/c

[PATCH] D62238: [CodeComplete] Complete a lambda when preferred type is a function

2019-05-22 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 200717. ilya-biryukov marked 3 inline comments as done. ilya-biryukov added a comment. - Add placeholder for captures. - Only accept classes that have exactly one template argument. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION htt

[PATCH] D62238: [CodeComplete] Complete a lambda when preferred type is a function

2019-05-22 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov marked an inline comment as done and an inline comment as not done. ilya-biryukov added inline comments. Comment at: clang/lib/Sema/SemaCodeComplete.cpp:4135 +!PotentialTemplateName.getAsIdentifierInfo()->getName().contains( +"function")) +

[PATCH] D62238: [CodeComplete] Complete a lambda when preferred type is a function

2019-05-22 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 200745. ilya-biryukov marked 4 inline comments as done. ilya-biryukov added a comment. - Only work on sugared types - Do not check for 'function' in the name Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D6

[PATCH] D62238: [CodeComplete] Complete a lambda when preferred type is a function

2019-05-22 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang/lib/Sema/SemaCodeComplete.cpp:4135 +!PotentialTemplateName.getAsIdentifierInfo()->getName().contains( +"function")) + return nullptr; kadircet wrote: > ilya-biryukov wrote: > > kadirc

[PATCH] D61386: [clang-tidy] Add support writing a check as a Transformer rewrite rule.

2019-05-22 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov marked an inline comment as done. ilya-biryukov added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp:46 + + StringRef Message = "no explanation"; + if (Case.Explanation) { ymandel wrote: > ilya-biryuk

[PATCH] D62238: [CodeComplete] Complete a lambda when preferred type is a function

2019-05-22 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Thanks for a quick review! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62238/new/ https://reviews.llvm.org/D62238 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[PATCH] D62238: [CodeComplete] Complete a lambda when preferred type is a function

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 200876. ilya-biryukov added a comment. - Remove a leftover from name check. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62238/new/ https://reviews.llvm.org/D62238 Files: clang/lib/Sema/SemaCodeComple

[PATCH] D62288: [clangd-vscode] Do not customize uri converters in vscode

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM, this improves the paths produced for generated files inside `bazel-genfiles`, we now point to the `/my/project/bazel-genfiles/path/to/some.proto.h` instead of `/path/to/ba

[PATCH] D36226: Added a RealFileSystem implementation that does not rely on global CWD.

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov abandoned this revision. ilya-biryukov added a subscriber: sammccall. ilya-biryukov added a comment. abandoning in favor of the change landed by @sammccall that resolves uses absolute paths instead of `at`-family functions. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D362

[PATCH] D53941: [clangd][wip] Add 'related information' to diagnostics. Does not work for built-in notes

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov abandoned this revision. ilya-biryukov added a subscriber: sammccall. ilya-biryukov added a comment. Herald added a project: clang. Abandoning, same functionality landed in separate revision by @sammccall Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://rev

[PATCH] D62298: [CodeComplete] Override completion items are filtered by funciton names

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: kadircet. Herald added a project: clang. We put only the function name into "typed text" chunks now, previously the whole signature was "typed text". This leads to meaningful fuzzy match scores, giving better signals to compare

[PATCH] D62298: [CodeComplete] Override completion items are filtered by funciton names

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Will need to update the test before landing, but wanted to share the implementation right away Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62298/new/ https://reviews.llvm.org/D62298 _

[PATCH] D62298: [CodeComplete] Override completion items are filtered by funciton names

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 200924. ilya-biryukov added a comment. - Use the old name for the helper function Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62298/new/ https://reviews.llvm.org/D62298 Files: clang/lib/Sema/SemaCode

[PATCH] D62298: [CodeComplete] Override completion items are filtered by funciton names

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 200926. ilya-biryukov added a comment. - Update the tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62298/new/ https://reviews.llvm.org/D62298 Files: clang/lib/Sema/SemaCodeComplete.cpp clang/tes

[PATCH] D62298: [CodeComplete] Filter override completions by function name

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Sorry for so many changes, this is ready for review now! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62298/new/ https://reviews.llvm.org/D62298 ___ cfe-commits mailing

[PATCH] D62298: [CodeComplete] Filter override completions by function name

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 200927. ilya-biryukov added a comment. - Simplify negative tests a bit Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62298/new/ https://reviews.llvm.org/D62298 Files: clang/lib/Sema/SemaCodeComplete.cp

[PATCH] D61386: [clang-tidy] Add support writing a check as a Transformer rewrite rule.

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp:46 + + StringRef Message = "no explanation"; + if (Case.Explanation) { ymandel wrote: > ilya-biryukov wrote: > > ymandel wrote: > > > ilya-biryukov

[PATCH] D62303: [Index] Fix reported references in presence of template type aliases

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: kadircet. Herald added subscribers: arphaman, jkorous. Herald added a project: clang. See the added test for an example. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D62303 Files: clang-tools-extra/clangd/

[PATCH] D62298: [CodeComplete] Filter override completions by function name

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang/lib/Sema/SemaCodeComplete.cpp:3166 +// Add a space after return type. +if (Chunk.Kind == CodeCompletionString::CK_ResultType) + Result.AddChunk(CodeCompletionString::CK_HorizontalSpace); kadircet

[PATCH] D62309: Fix linking of the refactor tweaks directory

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov requested changes to this revision. ilya-biryukov added a comment. This revision now requires changes to proceed. Thanks for the fix! A few nit-picky comments about the process, in case you'll be interested in sending more patches to LLVM. Could you please upload the patch with ful

[PATCH] D62298: [CodeComplete] Filter override completions by function name

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Summarizing the offline discussion, the final results we want in the long run is a completion item of the form: - Displayed to the user: `override foo(int a, int b)` - Inserted into the editor: `return_type foo(int a, int b) override` - Filtered by `override foo` (

[PATCH] D62298: [CodeComplete] Filter override completions by function name

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 201000. ilya-biryukov added a comment. Herald added subscribers: arphaman, jkorous. - Make first letter of the helper function lowercase - New model: everything before name is a text chunk, everything after it is typed chunk - Test the filter text produ

[PATCH] D62298: [CodeComplete] Filter override completions by function name

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov marked an inline comment as done. ilya-biryukov added a comment. I think that's a good step forward, although not yet ideal. The typed chunk now contains everything starting function name and ending with `override`, so one gets both nice prefix match scores when typing a function a

[PATCH] D62298: [CodeComplete] Filter override completions by function name

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. After landing this, will try to add new presentation options for completion items here. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62298/new/ https://reviews.llvm.org/D62298

[PATCH] D62328: [LibTooling] Fix dangling references in RangeSelector.

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62328/new/ https://reviews.llvm.org/D62328 _

[PATCH] D62303: [Index] Fix reported references in presence of template type aliases

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 201002. ilya-biryukov marked 2 inline comments as done. ilya-biryukov added a comment. - Address a comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62303/new/ https://reviews.llvm.org/D62303 Files:

[PATCH] D62303: [Index] Fix reported references in presence of template type aliases

2019-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang/lib/Index/IndexTypeSourceInfo.cpp:140 + bool IsTypeAlias) { +if (ResolvedClass) { + // In presence of type aliases, the resolved class was never written in k

[PATCH] D62340: [clang-tidy] In TransformerClangTidyCheck, require Explanation field.

2019-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM, thanks! Comment at: clang-tools-extra/unittests/clang-tidy/TransformerClangTidyCheckTest.cpp:38 " else ", statemen

[PATCH] D62372: [clangd] Limit the size of synthesized fix message

2019-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: kadircet. Herald added subscribers: arphaman, jkorous, MaskRay. Herald added a project: clang. A temporary workaround until we figure out a better way to present fixes. Repository: rG LLVM Github Monorepo https://reviews.llv

[PATCH] D62298: [CodeComplete] Filter override completions by function name

2019-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In D62298#1515399 , @kadircet wrote: > LGTM > > Have one question though, does it improve behavior in vscode? Since label > seems to be the same, it will most definitely improve clangd's ranking but > vscode ignores it anyw

[PATCH] D62298: [CodeComplete] Filter override completions by function name

2019-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang/lib/Sema/SemaCodeComplete.cpp:3172 +// Add a space after return type. +if (Chunk.Kind == CodeCompletionString::CK_ResultType) { + assert(!SeenTypedChunk); kadircet wrote: > do we expect anything

[PATCH] D62298: [CodeComplete] Filter override completions by function name

2019-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 201157. ilya-biryukov marked 4 inline comments as done. ilya-biryukov added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62298/new/ https://reviews.llvm.org/D62298 Files:

[PATCH] D62298: [CodeComplete] Filter override completions by function name

2019-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang/test/CodeCompletion/overrides.cpp:14 void vfunc(bool param) override; - void + vfo }; kadircet wrote: > nit: I suppose it should be `vfu`?(same thing for the comments below starting > with `Runs comple

[PATCH] D62298: [CodeComplete] Filter override completions by function name

2019-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 201161. ilya-biryukov marked 4 inline comments as done. ilya-biryukov added a comment. - Add whitespace outside printOverrideString Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62298/new/ https://reviews

[PATCH] D62298: [CodeComplete] Filter override completions by function name

2019-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang/lib/Sema/SemaCodeComplete.cpp:3172 +// Add a space after return type. +if (Chunk.Kind == CodeCompletionString::CK_ResultType) { + assert(!SeenTypedChunk); kadircet wrote: > ilya-biryukov wrote: >

[PATCH] D62298: [CodeComplete] Filter override completions by function name

2019-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 201164. ilya-biryukov added a comment. - Do not add an extra 'override' on optional chunks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62298/new/ https://reviews.llvm.org/D62298 Files: clang-tools-ex

[PATCH] D62298: [CodeComplete] Filter override completions by function name

2019-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 201168. ilya-biryukov added a comment. - Update a comment in the test - Reformat the code Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62298/new/ https://reviews.llvm.org/D62298 Files: clang-tools-ext

[PATCH] D62298: [CodeComplete] Filter override completions by function name

2019-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 201167. ilya-biryukov added a comment. - Remove redundant test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62298/new/ https://reviews.llvm.org/D62298 Files: clang-tools-extra/clangd/unittests/CodeCom

[PATCH] D62372: [clangd] Limit the size of synthesized fix message

2019-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 201179. ilya-biryukov marked 2 inline comments as done. ilya-biryukov added a comment. - Address comments, simplify Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62372/new/ https://reviews.llvm.org/D62372

[PATCH] D62389: [clangd] Place cursor better after completing patterns

2019-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: hokein. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. By producing the $0 marker in the snippets at the last placeholder. This produces nicer results in most cases, e.g. for nam

[PATCH] D62390: [LibTooling] Add Explanation parameter to `makeRule`.

2019-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM. Much nicer now! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62390/new/ https://reviews.llvm.org/D62390

[PATCH] D62391: [CodeComplete] Complete 'return true/false' in boolean functions

2019-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: kadircet. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D62391 Files: clang/lib/Sema/SemaCodeComplete.cpp clang/test/CodeCompletion/patterns.cpp Index: clang/test/CodeComple

[PATCH] D62405: [CodeComplete] Consistently break after '{' in multi-line patterns

2019-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: gribozavr. Herald added a project: clang. Completion can return multi-line patterns in some cases, e.g. for (<#init#>; <#cond#>; <#inc#>) { <#body#> } However, most patterns break the line only before closing brace, resul

[PATCH] D62412: [clang-tidy] Fix unused-variable warning after r361647.

2019-05-27 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM Comment at: clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp:21 : ClangTidyCheck(Name, Context), Rule(std::move(R)) { - for (const au

[PATCH] D62476: [clangd] Support offsets for parameters in signatureHelp

2019-05-27 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: hokein. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. Added to LSP in version 3.14 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D62476 Files: clang-tools-ex

[PATCH] D62476: [clangd] Support offsets for parameters in signatureHelp

2019-05-27 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 201487. ilya-biryukov added a comment. - Fix compilation when assertions are enabled Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62476/new/ https://reviews.llvm.org/D62476 Files: clang-tools-extra/cl

[PATCH] D62389: [clangd] Place cursor better after completing patterns

2019-05-27 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In D62389#1517844 , @hokein wrote: > I'm not sure the new behavior suits all cases, it seems to me that this will > change a typical behavior (usually when users invoke function calls). > > Imaging a case: > > void foo(int

[PATCH] D62389: [clangd] Place cursor better after completing patterns

2019-05-27 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov marked an inline comment as done. ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/CodeCompletionStrings.h:41 /// *Signature = "(size_type) const" -/// *Snippet = "(${0:size_type})" +/// *Snippet = "(${1:size_type})" /// If set, Requ

[PATCH] D62476: [clangd] Support offsets for parameters in signatureHelp

2019-05-27 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 201493. ilya-biryukov added a comment. - Fix parsing of a client capability, add a test for a capability Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62476/new/ https://reviews.llvm.org/D62476 Files:

[PATCH] D60605: [clangd] Revamp textDocument/onTypeFormatting.

2019-05-27 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM with a few NITs and a few questions about the possibility of moving this to `clang-format` at some point in the future. From what I can to simplify the calling, we need to:

[PATCH] D62389: [clangd] Place cursor better after completing patterns

2019-05-27 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 201517. ilya-biryukov added a comment. - Add a code completion test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62389/new/ https://reviews.llvm.org/D62389 Files: clang-tools-extra/clangd/CodeComplete

[PATCH] D62389: [clangd] Place cursor better after completing patterns

2019-05-27 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In D62389#1518030 , @hokein wrote: > How about adding one more test in CodeCompleteTests.cpp, we already have a > snippet test there, and it seems more straightforward. Done! Repository: rG LLVM Github Monorepo CHANGE

[PATCH] D62514: [CodeComplete] Set preferred type for qualified-id

2019-05-28 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: kadircet. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D62514 Files: clang/include/clang/Sema/Sema.h clang/lib/Parse/ParseExprCXX.cpp clang/lib/Sema/SemaCodeComplete.cpp

[PATCH] D62515: [clangd] Compute expected type for templates

2019-05-28 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: sammccall. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D62515 Files: clang-tools-extra/clangd/ExpectedTypes.cpp

[PATCH] D62514: [CodeComplete] Set preferred type for qualified-id

2019-05-28 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In D62514#1518941 , @kadircet wrote: > thanks, lgtm. > > one irrelevant question though, it looks like most of the calls to > `ResultBuilder::setPreferredType` performs a `!isNull` check before hand. > should we perform thi

[PATCH] D62419: [LibTooling] Add `before` and `after` selectors for selecting point-ranges relative to nodes.

2019-05-28 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov marked an inline comment as done. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM! Comment at: clang/lib/Tooling/Refactoring/RangeSelector.cpp:124 +return CharSourceRange::getCharRange(

[PATCH] D62573: [Index] Correctly set symbol kind of IndirectFieldDecl

2019-05-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: kadircet. Herald added subscribers: arphaman, jkorous. Herald added a project: clang. The kind has been 'unknown' before, now it is 'field'. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D62573 Files: clang

[PATCH] D61601: [clangd] Represent Hover result using FormattedString

2019-05-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 201844. ilya-biryukov added a comment. - Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61601/new/ https://reviews.llvm.org/D61601 Files: clang-tools-extra/clangd/ClangdLSPServer.cpp clang-tool

[PATCH] D61601: [clangd] Represent Hover result using FormattedString

2019-05-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. This is ready for review now Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61601/new/ https://reviews.llvm.org/D61601 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[PATCH] D61601: [clangd] Represent Hover result using FormattedString

2019-05-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 201847. ilya-biryukov marked 2 inline comments as done. ilya-biryukov added a comment. - Create an inline code block for 'global namespace' too Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61601/new/ htt

[PATCH] D61601: [clangd] Represent Hover result using FormattedString

2019-05-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/XRefs.cpp:1170 else if (NamespaceScope->empty()) - Out << "global namespace"; + Output.appendText(" global namespace"); else kadircet wrote: > Should this also be `inlin

[PATCH] D62573: [Index] Correctly set symbol kind of IndirectFieldDecl

2019-05-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In D62573#1520641 , @kadircet wrote: > Do you think it would be beneficial to add some logging for the default case > of that switch statement ? We should replace `default` with all cases it covers to make sure we get a w

[PATCH] D62579: [Index] Compute correct symbol kind for variable templates

2019-05-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: kadircet. Herald added subscribers: arphaman, jkorous. Herald added a project: clang. The index library itself seems to never pass variable templates as input, however clangd does. Repository: rG LLVM Github Monorepo https:/

[PATCH] D62579: [Index] Compute correct symbol kind for variable templates

2019-05-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang/lib/Index/IndexSymbol.cpp:99 + if (auto *VT = dyn_cast(D)) { +Info.Properties |= (SymbolPropertySet)SymbolProperty::Generic; kadircet wrote: > what about function and class templates? Are they handled

[PATCH] D62582: [CodeComplete] Improve overload handling for C++ qualified and ref-qualified methods.

2019-05-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: lib/Sema/SemaCodeComplete.cpp:1300 +auto &OverloadSet = +OverloadMap[std::make_pair(CurContext, Method->getName())]; +for (const DeclIndexPair& Entry : OverloadSet) { Won't this crash on

[PATCH] D62579: [Index] Compute correct symbol kind for variable templates

2019-05-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 201980. ilya-biryukov marked 4 inline comments as done. ilya-biryukov added a comment. - Add a test for static variable template member Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62579/new/ https://rev

[PATCH] D62615: [CodeComplete] Include more text into typed chunks of pattern completions

2019-05-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: sammccall. Herald added a project: clang. To allow filtering on any of the words in the editors. In particular, the following completions were changed: - 'using namespace <#name#>' Typed text before: 'using', after: 'using name

[PATCH] D62579: [Index] Compute correct symbol kind for variable templates

2019-05-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang/lib/Index/IndexSymbol.cpp:99 + if (auto *VT = dyn_cast(D)) { +Info.Properties |= (SymbolPropertySet)SymbolProperty::Generic; kadircet wrote: > ilya-biryukov wrote: > > kadircet wrote: > > > what about

[PATCH] D62616: [CodeComplete] Add a bit more whitespace to completed patterns

2019-05-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: gribozavr. Herald added subscribers: kadircet, arphaman, jkorous. Herald added a project: clang. E.g. we now turn `while(<#cond#>){` into `while (<#cond#>) {` This slightly improves the final output. Should not affect clients th

[PATCH] D55359: [clangd] Avoid emitting Queued status when we are able to acquire the Barrier.

2018-12-13 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55359/new/ https://reviews.llvm.org/D55359 __

[PATCH] D41005: Reuse preamble even if an unsaved file does not exist

2018-12-13 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: lib/Frontend/PrecompiledPreamble.cpp:459 +if (moveOnNoError(VFS->status(RB.first), Status)) { + OverriddenFiles[Status.getUniqueID()] = PreambleHash; +} else { NIT: remove braces around single-statemen

[PATCH] D48116: [libclang] Allow skipping warnings from all included files

2018-12-13 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In D48116#1322878 , @nik wrote: > In D48116#1144732 , @ilya-biryukov > wrote: > > > Have you considered doing the same filtering in ASTUnit's > > `StoredDiagnosticConsumer`? It shoul

[PATCH] D55191: [clangd] Refine the way of checking a declaration is referenced by the written code.

2018-12-13 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM. Many thanks for the fix, really important to get those cases right. Comment at: unittests/clangd/XRefsTests.cpp:1228 +TEST(FindReferences, ExplicitSymbo

[PATCH] D55455: Remove stat cache chaining as it's no longer needed after PTH support has been removed

2018-12-13 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Yay! Anything that makes `FileManager` and friends simpler LG Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55455/new/ https://reviews.llvm.org/D55455 ___ cfe-commits mailing list cfe-c

<    14   15   16   17   18   19   20   21   22   23   >