[PATCH] D60409: [clangd] Add -header-insertion=never flag to disable include insertion in code completion

2019-04-10 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. sammccall marked an inline comment as done. Closed by commit rL358075: [clangd] Add -header-insertion=never flag to disable include insertion in code… (authored by sammccall, committed by ). Herald added a project: LLVM. Her

[PATCH] D60126: [clangd] Use identifiers in file as completion candidates when build is not ready.

2019-04-10 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Very nice! D60503 will conflict, feel free to stall that until this is landed. On the other hand it will simplify some things, e.g. the prefix is already calculated, and typed scope is available if you want that (no enclosing namespac

[PATCH] D60503: [clangd] Don't insert extra namespace qualifiers when Sema gets lost.

2019-04-10 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL358091: [clangd] Don't insert extra namespace qualifiers when Sema gets lost. (authored by sammccall, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior t

[PATCH] D60126: [clangd] Use identifiers in file as completion candidates when build is not ready.

2019-04-11 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added inline comments. This revision is now accepted and ready to land. Comment at: clangd/CodeComplete.cpp:345 + Completion.Origin |= SymbolOrigin::Identifier; + Completion.Name = C.IdentifierResult->Name; +}

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

2019-04-12 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added reviewers: ilya-biryukov, hokein. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ioeric, mgorny. Herald added a project: clang. The existing implementation (which triggers on }) is fairly simple and has flaws: - doesn

[PATCH] D60539: Add -std=c++14 language standard option to tests that require C++14 default

2019-04-12 Thread Sam McCall via Phabricator via cfe-commits
sammccall requested changes to this revision. sammccall added a comment. This revision now requires changes to proceed. Herald added a subscriber: jsji. I don't think this is a suitable fix :-( There are lots of places where we construct command-lines in tests, it may be true today that this is

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

2019-04-12 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 194855. sammccall added a comment. Unit tests. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60605/new/ https://reviews.llvm.org/D60605 Files: clangd/CMakeLists.txt clangd/ClangdLSPServer.cpp clangd/Cla

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

2019-04-16 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 195338. sammccall added a comment. Lots more test cases and better handling of braced blocks. This turns out to be an interesting case: if (foo) { ^} Really the right thing to do here is insert another newline. Unfortuantely that means inserting text

[PATCH] D60687: [clangd] Check file path of declaring header when deciding whether to insert include.

2019-04-16 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land. Thanks! IIUC, this already fixes the cases we'd seen of include-insertion of a header into itself. Is it feasible to add a test case for that? Comment at: clangd/Head

[PATCH] D60687: [clangd] Check file path of declaring header when deciding whether to insert include.

2019-04-16 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: unittests/clangd/HeadersTests.cpp:208 TEST_F(HeadersTest, DoNotInsertIfInSameFile) { MainFile = testPath("main.h"); ioeric wrote: > > IIUC, this already fixes the cases we'd seen of include-insertion of a > > he

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

2019-04-16 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang/include/clang/Tooling/Syntax/TokenBuffer.h:146 + llvm::Optional> + toOffsetRange(const Token *Begin, const Token *End, +const SourceManager &SM) const; ilya-biryukov wrote: > ilya-biryukov wrote

[PATCH] D60539: Add -std=c++14 language standard option to tests that require C++14 default

2019-04-16 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In D60539#1469012 , @nemanjai wrote: > > Do you need to build clangd? We explicitly don't aim to support building > > everywhere clang can be built, maybe we should just disable in this case? > > Our environment includes various

[PATCH] D60316: [clangd] Include insertion: require header guards, drop other heuristics, treat .def like .inc.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 195519. sammccall marked 3 inline comments as done. sammccall added a comment. address review comments Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60316/new/ https://reviews.llvm.org/D60316 Files: clangd/

[PATCH] D58291: [clangd] Include textual diagnostic ID as Diagnostic.code.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 195522. sammccall marked an inline comment as done. sammccall added a comment. Herald added a subscriber: dexonsmith. Rebase to head and expand scope a bit: - now also setting code for clang-tidy checks - to enable this to be used from the C++ API, the stri

[PATCH] D58291: [clangd] Include textual diagnostic ID as Diagnostic.code.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
sammccall marked an inline comment as done. sammccall added a comment. In D58291#1400569 , @kadircet wrote: > LG but is this information really useful to users? According to LSP `The > diagnostic's code, which might appear in the user interface.`, I think

[PATCH] D60316: [clangd] Include insertion: require header guards, drop other heuristics, treat .def like .inc.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL358571: [clangd] Include insertion: require header guards, drop other heuristics, treat… (authored by sammccall, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Chan

[PATCH] D60815: [clangd] Recognize "don't include me directly" pattern, and suppress include insertion.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added a reviewer: ioeric. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. Typically used with umbrella headers, e.g. GTK: #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILA

[PATCH] D60815: [clangd] Recognize "don't include me directly" pattern, and suppress include insertion.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 195533. sammccall added a comment. unconfusing my git repo Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60815/new/ https://reviews.llvm.org/D60815 Files: clangd/index/SymbolCollector.cpp clangd/index/Sym

[PATCH] D60815: [clangd] Recognize "don't include me directly" pattern, and suppress include insertion.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 195534. sammccall marked an inline comment as done. sammccall added a comment. remove leftover debugging Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60815/new/ https://reviews.llvm.org/D60815 Files: clang

[PATCH] D60815: [clangd] Recognize "don't include me directly" pattern, and suppress include insertion.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
sammccall marked an inline comment as done. sammccall added inline comments. Comment at: clangd/index/SymbolCollector.cpp:602 +/// Returns None if includes should not be inserted for this file. +llvm::Optional +SymbolCollector::getIncludeHeader(llvm::StringRef QName, FileID FID)

[PATCH] D58291: [clangd] Include textual diagnostic ID as Diagnostic.code.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In D58291#1469917 , @kadircet wrote: > In D58291#1469880 , @sammccall wrote: > > > It's a good question, it depends how this is surfaced, and we may want to > > tweak the behavior or supp

[PATCH] D58291: [clangd] Include textual diagnostic ID as Diagnostic.code.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rCTE358575: [clangd] Include textual diagnostic ID as Diagnostic.code. (authored by sammccall, committed by ). Changed prio

[PATCH] D60819: [clangd] Strip the ' [some-check-name]' suffix from clang-tidy diagnostics. The check name is reported in Diagnostic.code.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added a reviewer: kadircet. Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. Herald added a project: clang. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D60819 Files: clangd/Diagnostics.cpp

[PATCH] D60822: [clangd] Use shorter, more recognizable codes for diagnostics.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added a reviewer: kadircet. Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. Herald added a project: clang. - for warnings, use "foo" if the warning is controlled by -Wfoo - for errors, keep using the internal nam

[PATCH] D60815: [clangd] Recognize "don't include me directly" pattern, and suppress include insertion.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 195562. sammccall added a comment. DontIncludeMePattern Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60815/new/ https://reviews.llvm.org/D60815 Files: clangd/index/SymbolCollector.cpp clangd/index/Symbol

[PATCH] D60815: [clangd] Recognize "don't include me directly" pattern, and suppress include insertion.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
sammccall marked 2 inline comments as done. sammccall added inline comments. Comment at: clangd/index/SymbolCollector.cpp:631 + +bool SymbolCollector::isSelfContainedHeader(FileID FID) { + // The real computation (which will be memoized). ioeric wrote: > sammcca

[PATCH] D60815: [clangd] Recognize "don't include me directly" pattern, and suppress include insertion.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE358605: [clangd] Recognize "don't include me directly" pattern, and suppress include… (authored by sammccall, committed by ). Changed prior to commit: https://reviews.llvm.org/D60815?vs=195562&id=195

[PATCH] D60822: [clangd] Use shorter, more recognizable codes for diagnostics.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 195623. sammccall added a comment. -Wfoo instead of foo Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60822/new/ https://reviews.llvm.org/D60822 Files: clangd/Diagnostics.cpp test/clangd/compile-commands-

[PATCH] D60822: [clangd] Use shorter, more recognizable codes for diagnostics.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE358611: [clangd] Use shorter, more recognizable codes for diagnostics. (authored by sammccall, committed by ). Changed prior to commit: https://reviews.llvm.org/D60822?vs=195623&id=195624#toc Reposit

[PATCH] D60822: [clangd] Use shorter, more recognizable codes for diagnostics.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In D60822#1470227 , @kadircet wrote: > I agree that these are more useful. What about also adding "-W" in front of > warning flags to make them more explicit and stand out from "non-flag" error > names? I went back and forth

[PATCH] D60819: [clangd] Strip the ' [some-check-name]' suffix from clang-tidy diagnostics. The check name is reported in Diagnostic.code.

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE358612: [clangd] Strip the ' [some-check-name]' suffix from clang-tidy diagnostics. The… (authored by sammccall, committed by ). Changed prior to commit: https://reviews.llvm.org/D60819?vs=195548&id=1

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

2019-04-17 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. @kadircet if you're interested in the behavior here, you can patch this in and try out with vscode. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60605/new/ https://reviews.llvm.org/D60605 _

[PATCH] D60821: [clangd] Emit better error messages when rename fails.

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang-tools-extra/clangd/ClangdServer.cpp:57 public: + RefactoringResultCollector(DiagnosticsEngine &DE) : Diags(DE) {} void handleError(llvm::Error Err) override { why inject the DE here (and handle mapping error

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall marked 9 inline comments as done. sammccall added inline comments. Comment at: clangd/Diagnostics.cpp:280 + Main.relatedInformation->push_back(std::move(RelInfo)); +} } ilya-biryukov wrote: > NIT: maybe call `OutFn` and return here to avoid

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 195694. sammccall marked an inline comment as done. sammccall added a comment. Rebase and address comments. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60267/new/ https://reviews.llvm.org/D60267 Files: cl

[PATCH] D60821: [clangd] Emit better error messages when rename fails.

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land. LG, thanks! I do think it can be further simplified, but if not then land as-is. Comment at: clang-tools-extra/clangd/ClangdServer.cpp:57 public: + RefactoringResult

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 195707. sammccall added a comment. Remove accidental copy/paste in lit test. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60267/new/ https://reviews.llvm.org/D60267 Files: clangd/ClangdLSPServer.cpp clan

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 195706. sammccall added a comment. Propagate the capability to Diagnostics, add lit test. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60267/new/ https://reviews.llvm.org/D60267 Files: clangd/ClangdLSPServ

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall marked 2 inline comments as done. sammccall added inline comments. Comment at: clangd/Diagnostics.cpp:271 + if (!Note.AbsFile) { +log("Dropping note from unknown file: {0}", Note); +continue; kadircet wrote: > ilya-biryukov wrote: >

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Discussed further offline - it's not clear that expressing the flattening as LSP diagnostic -> LSP diagnostic is better than the current Diag -> LSP diagnostic. So that followup probably won't happen, and there isn't that much to be gained from "unifying" the behavio

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL358675: [clangd] Support relatedInformation in diagnostics. (authored by sammccall, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SI

[PATCH] D60873: [clang][HeaderSuggestion] Handle the case of dotdot with an absolute path

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land. Well done! I never managed to track this one down, this was really annoying. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60873/new/ http

[PATCH] D60873: [clang][HeaderSuggestion] Handle the case of dotdot with an absolute path

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang-tools-extra/unittests/clangd/HeadersTests.cpp:220 + BarHeader = testPath("sub/bar.h"); + EXPECT_EQ(calculate(BarHeader), "\"sub/bar.h\""); } ormris wrote: > Quick nit: This test won't work on Windows as it onl

[PATCH] D60873: [clang][HeaderSuggestion] Handle the case of dotdot with an absolute path

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang-tools-extra/unittests/clangd/HeadersTests.cpp:220 + BarHeader = testPath("sub/bar.h"); + EXPECT_EQ(calculate(BarHeader), "\"sub/bar.h\""); } ormris wrote: > sammccall wrote: > > ormris wrote: > > > Quick nit:

[PATCH] D60937: [clangd] Fix code completion of macros defined in the preamble region of the main file.

2019-04-20 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ioeric. Herald added a project: clang. This is a tricky case (we baked the assumption that symbols come from the preamble xor mainfile pretty de

[PATCH] D60995: [clangd] Make sure include path does not contain any backslashes on Windows

2019-04-23 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. This looks like a bug rather than a feature of HeaderSearch, shouldn't the slash conversion go there? (It seems unlikely that diagnostics should suggest one thing but we insert another) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revie

[PATCH] D60995: [clang][HeaderSearch] Make sure there are no backslashes in suggestedPath

2019-04-24 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land. Thanks! Can you document this in `HeaderSearch.h`? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60995/new/ https://reviews.llvm.org/D6099

[PATCH] D60995: [clang][HeaderSearch] Make sure there are no backslashes in suggestedPath

2019-04-24 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang/include/clang/Lex/HeaderSearch.h:710 + /// Suggest a path by which the specified file could be found, for use in + /// diagnostics to suggest a #include. Returned path will be valid for + /// include-directive. ---

[PATCH] D61077: [clangd] Query index in code completion no-compile mode.

2019-04-24 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added a reviewer: kadircet. Herald added subscribers: cfe-commits, arphaman, mgrang, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. We scrape the enclosing scopes from the source file, and use them in the query. Repository: rCTE Clan

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

2019-04-24 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 196538. sammccall added a comment. Fix comment wrapping behavior: - when splitting a comment before //, don't add another // - if the editor inserts // before the cursor to continue a line comment, indent it and adjust to three slashes if needed. This doe

[PATCH] D61120: [clangd] Optimize "don't include me" check.

2019-04-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. llvm::Regex is really slow, and regex evaluation during preamble indexing was showing up as 25% on a profile of cl

[PATCH] D59814: [Testing] Move clangd::Annotations to llvm testing support

2019-04-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added inline comments. Comment at: llvm/lib/Testing/Support/Annotations.cpp:94 +const llvm::Annotations::Range &R) { + return O << llvm::formatv("[{0}, {1})", R.Begin, R.End); +} You

[PATCH] D61122: [clangd] Don't build clangd or run its tests when LLVM_ENABLE_THREADS is off, unless specifically directed to do so

2019-04-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added reviewers: thakis, ilya-biryukov. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, mgorny. Herald added a project: clang. Introduce a new CLANGD_BUILD option, only default to true if threads are on. (the name doesn't se

[PATCH] D61120: [clangd] Optimize "don't include me" check.

2019-04-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clangd/index/SymbolCollector.cpp:669 +return false; + return Line.contains_lower("includ"); +} ilya-biryukov wrote: > A typo? Should it be `include`. it's meant to match "include" or "including". I'll add a commen

[PATCH] D53072: [clang-format] Create a new tool for IDEs based on clang-format

2019-04-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. You may be interested in D60605 , which is a related idea (adding incremental format-and-indent-on-type to clangd). These are opposite extremes in some sense: this patch integrates deeply into clang-format and that patch entirely layer

[PATCH] D59407: [clangd] Add RelationSlab

2019-04-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a subscriber: hokein. sammccall added a comment. Hi Nathan, sorry for the stall here, and for repeatedly going over the same issues. The design space here is pretty complicated. I think the conclusion of recent offline discussions is: - refs and relations can be the same thing-i

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

2019-04-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 196656. sammccall added a comment. Avoid removing lines when formatting after \n. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60605/new/ https://reviews.llvm.org/D60605 Files: clangd/CMakeLists.txt clan

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

2019-04-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In D60605#1478579 , @ilya-biryukov wrote: > Another example: > > int test() { > > ^ > } > > > Expected: a newline was added. > Actual: newline does not allow to be added. Fixed. In D60605#1478581

[PATCH] D61077: [clangd] Query index in code completion no-compile mode.

2019-04-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 196671. sammccall marked 2 inline comments as done. sammccall added a comment. Add comments, add anon-namespacce test, tighten parsing rules slightly (`namespace ::...` is illegal) Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://

[PATCH] D61077: [clangd] Query index in code completion no-compile mode.

2019-04-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall marked 3 inline comments as done. sammccall added inline comments. Comment at: clangd/SourceCode.cpp:503 +case tok::l_brace: + if (State == NamespaceName) { +// Parsed: namespace { kadircet wrote: > I believe it is safe to ignore(just

[PATCH] D61077: [clangd] Query index in code completion no-compile mode.

2019-04-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 196674. sammccall marked an inline comment as done. sammccall added a comment. Correctly handle absolutely qualifier (::foo::bar). Fix seed scopes for proximity to be consistent with Sema case. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTIO

[PATCH] D61077: [clangd] Query index in code completion no-compile mode.

2019-04-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 196676. sammccall added a comment. Fix test. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61077/new/ https://reviews.llvm.org/D61077 Files: clangd/CodeComplete.cpp clangd/SourceCode.cpp clangd/SourceCo

[PATCH] D61120: [clangd] Optimize "don't include me" check.

2019-04-25 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. sammccall marked 3 inline comments as done. Closed by commit rCTE359214: [clangd] Optimize "don't include me" check. (authored by sammccall, committed by ). Changed prior to commit: https://reviews.llvm.org/D61120?vs=1965

[PATCH] D60953: [clangd] Respect clang-tidy suppression comments

2019-04-26 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Thanks for doing this! Comment at: clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp:395 + DiagLevel != DiagnosticsEngine::Fatal && + LineIsMarkedWithNOLINTinMacro(Info.getSourceManager(), +

[PATCH] D61077: [clangd] Query index in code completion no-compile mode.

2019-04-26 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL359284: [clangd] Query index in code completion no-compile mode. (authored by sammccall, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANG

[PATCH] D61187: [clangd] Move clangd tests to clangd directory. check-clangd is no longer part of check-clang-tools.

2019-04-26 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added a reviewer: gribozavr. Herald added subscribers: cfe-commits, jfb, kadircet, arphaman, jkorous, MaskRay, javed.absar, mgorny. Herald added a project: clang. sammccall added a comment. Herald added a subscriber: ormris. @ilya-biryukov Can you check

[PATCH] D61187: [clangd] Move clangd tests to clangd directory. check-clangd is no longer part of check-clang-tools.

2019-04-26 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Herald added a subscriber: ormris. @ilya-biryukov Can you check this with a shared library build? Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61187/new/ https://reviews.llvm.org/D61187

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

2019-04-26 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 196864. sammccall added a comment. Fix more comment contination cases. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60605/new/ https://reviews.llvm.org/D60605 Files: clangd/CMakeLists.txt clangd/ClangdLS

[PATCH] D61187: [clangd] Move clangd tests to clangd directory. check-clangd is no longer part of check-clang-tools.

2019-04-29 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 197058. sammccall added a comment. Zap test/Unit directory, put lit.cfg in unittests directly. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61187/new/ https://reviews.llvm.org/D61187 Files: CMakeLists.txt

[PATCH] D61187: [clangd] Move clangd tests to clangd directory. check-clangd is no longer part of check-clang-tools.

2019-04-29 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Also for the record, none of the buildbots in zorg mention check-clang-tools. Bots run tests by enabling clang-tools-extra and then `check-all`, so this patch shouldn't change their behavior. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://r

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

2019-04-29 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall marked an inline comment as done. sammccall added a comment. This revision is now accepted and ready to land. Rest is details only. Comment at: clang/include/clang/Tooling/Syntax/Tokens.h:59 + explicit Token(const clang::Token &T); +

[PATCH] D61187: [clangd] Move clangd tests to clangd directory. check-clangd is no longer part of check-clang-tools.

2019-04-29 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL359424: [clangd] Move clangd tests to clangd directory. check-clangd is no longer part… (authored by sammccall, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Chang

[PATCH] D59302: [clangd] Surface diagnostics from headers inside main file

2019-04-29 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land. Nice! Just readability/wording nits Comment at: clangd/Diagnostics.cpp:463 + // header. + auto ShouldAddDiag = [this](const Diag &D) { +if (mentionsMainFile(D)) -

[PATCH] D61316: [clangd] Improvements to header mapping: more precise parsing of cppreference symbol pages.

2019-04-30 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added a reviewer: kadircet. Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. Previously we were just jumping from the symbol index to the symbol page, and grabbing all the headers mentioned

[PATCH] D61316: [clangd] Improvements to header mapping: more precise parsing of cppreference symbol pages.

2019-04-30 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 197350. sammccall added a comment. fix std::chrono regression Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61316/new/ https://reviews.llvm.org/D61316 Files: clangd/StdSymbolMap.inc clangd/include-mapping

[PATCH] D61187: [clangd] Move clangd tests to clangd directory. check-clangd is no longer part of check-clang-tools.

2019-04-30 Thread Sam McCall via Phabricator via cfe-commits
sammccall marked 3 inline comments as done. sammccall added inline comments. Comment at: clang-tools-extra/trunk/clangd/unittests/lit.cfg.in:1 +@LIT_SITE_CFG_IN_HEADER@ +# This is a shim to run the gtest unittests in ../unittests using lit. MaskRay wrote: > thaki

[PATCH] D61349: [clangd] Standard library mapping: prefer "primary" versions of functions over variants.

2019-04-30 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added a reviewer: kadircet. Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D61349 Files: clangd/StdSymbolMap.inc clangd/

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

2019-04-30 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In D60605#1483729 , @ilya-biryukov wrote: > Found today: I'm not able to reproduce this, can you give a complete example? Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60605/new/

[PATCH] D60937: [clangd] Fix code completion of macros defined in the preamble region of the main file.

2019-04-30 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Ping :-) Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60937/new/ https://reviews.llvm.org/D60937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[PATCH] D61187: [clangd] Move clangd tests to clangd directory. check-clangd is no longer part of check-clang-tools.

2019-05-01 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. So, apologies everyone for the trouble caused by this patch, and thanks for all the information. It was a mistake to try to change so many things at once. I'll switch the layout back as far as possible while preserving the directory structure. This is a frustrating as

[PATCH] D61316: [clangd] Improvements to header mapping: more precise parsing of cppreference symbol pages.

2019-05-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 197717. sammccall added a comment. rebase Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61316/new/ https://reviews.llvm.org/D61316 Files: clangd/StdSymbolMap.inc clangd/include-mapping/gen_std.py clangd

[PATCH] D61316: [clangd] Improvements to header mapping: more precise parsing of cppreference symbol pages.

2019-05-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clangd/include-mapping/gen_std.py:90 +# Decl may not be for the symbol name we're looking for. +if not re.search("\\b%s\\b" % symbol_name, text): + continue kadircet wrote: > does this also wor

[PATCH] D61316: [clangd] Improvements to header mapping: more precise parsing of cppreference symbol pages.

2019-05-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 197716. sammccall added a comment. Add explanatory comment about headers reset. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61316/new/ https://reviews.llvm.org/D61316 Files: clangd/CodeComplete.cpp clan

[PATCH] D61316: [clangd] Improvements to header mapping: more precise parsing of cppreference symbol pages.

2019-05-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 197715. sammccall marked 2 inline comments as done. sammccall added a comment. Herald added a subscriber: mgorny. Update tests. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61316/new/ https://reviews.llvm.org

[PATCH] D61349: [clangd] Standard library mapping: prefer "primary" versions of functions over variants.

2019-05-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 197719. sammccall added a comment. Add note about skipping variants, and mention the weird begin/end case. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61349/new/ https://reviews.llvm.org/D61349 Files: cla

[PATCH] D61349: [clangd] Standard library mapping: prefer "primary" versions of functions over variants.

2019-05-02 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE359770: [clangd] Standard library mapping: prefer "primary" versions of functions over… (authored by sammccall, committed by ). Changed prior to commit: https://reviews.llvm.org/D61349?vs=197719&id=1

[PATCH] D61316: [clangd] Improvements to header mapping: more precise parsing of cppreference symbol pages.

2019-05-02 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE359771: [clangd] Improvements to header mapping: more precise parsing of cppreference… (authored by sammccall, committed by ). Changed prior to commit: https://reviews.llvm.org/D61316?vs=197717&id=197

[PATCH] D60937: [clangd] Fix code completion of macros defined in the preamble region of the main file.

2019-05-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 197734. sammccall added a comment. Herald added a subscriber: mgrang. Record macro names while building preamble instead of lexing it later. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60937/new/ https://rev

[PATCH] D60937: [clangd] Fix code completion of macros defined in the preamble region of the main file.

2019-05-02 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE359778: [clangd] Fix code completion of macros defined in the preamble region of the… (authored by sammccall, committed by ). Changed prior to commit: https://reviews.llvm.org/D60937?vs=197734&id=1977

[PATCH] D61442: [clangd] Fix header-guard check for include insertion, and don't index header guards.

2019-05-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added a reviewer: kadircet. Herald added subscribers: cfe-commits, arphaman, mgrang, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. Both of these attempt to check whether a header guard exists while parsing the file. However the file is

[PATCH] D60937: [clangd] Fix code completion of macros defined in the preamble region of the main file.

2019-05-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In D60937#1487976 , @RKSimon wrote: > @sammccall I'm sorry but I had to revert this to fix the buildbots: > http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/47684/ No worries, thanks for reve

[PATCH] D61126: [clangd] Also perform merging for symbol definitions

2019-05-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clangd/XRefs.cpp:350 if (R.Definition) { // from AST +// In case of generated files we prefer to omit the definition in

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. This looks pretty nice to me! Sorry for the wait. Adding @kadircet as hover-guru-in-waiting. Comment at: clang-tools-extra/clangd/ClangdLSPServer.cpp:814 +return Reply(llvm::None); + // FIXME: rende

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

2019-05-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 197928. sammccall added a comment. Fix latest case (trailing comment outdented in vscode). Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60605/new/ https://reviews.llvm.org/D60605 Files: clangd/CMakeLists.t

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

2019-05-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In D60605#1488039 , @ilya-biryukov wrote: > Maybe that's due to some extra logic applied in VSCode on top of what we do. > Let me know if this does not reproduce. Aha, the missing piece was that vscode reindented the cursor t

[PATCH] D61495: [clangd] Use more relaxed fuzzy-matching rules for local variables and class members.

2019-05-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. I think the actual rules implemented here are probably *too* relaxed, and we should require the first character to

[PATCH] D61442: [clangd] Fix header-guard check for include insertion, and don't index header guards.

2019-05-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 197967. sammccall marked 3 inline comments as done. sammccall added a comment. Extract setIncludeLocation() and call it from a more obvious point in the code. Tweak test to make it harder. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION h

[PATCH] D61442: [clangd] Fix header-guard check for include insertion, and don't index header guards.

2019-05-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clangd/index/SymbolCollector.h:130 + // The final spelling is calculated in finish(). + llvm::DenseMap IncludeFiles; + // Indexed macros, to be erased if they turned out to be include guards. kadircet wrote: > This

[PATCH] D61442: [clangd] Fix header-guard check for include insertion, and don't index header guards.

2019-05-03 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE359880: [clangd] Fix header-guard check for include insertion, and don't index header… (authored by sammccall, committed by ). Changed prior to commit: https://reviews.llvm.org/D61442?vs=197967&id=197

[PATCH] D61518: [clangd] add CLANG_ENABLE_CLANGD option to build clangd. Require threads.

2019-05-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added a reviewer: gribozavr. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov, mgorny. Herald added a project: clang. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D61518 Files: CMakeLists.txt

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