[clang] [clang-tools-extra] [llvm] [clangd] Avoid bogus error about recursive inclusion (PR #95200)

2024-06-11 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: The title of the PR can probably be improved. The current title describes the symptom the patch fixes rather than the change it makes (which I don't understand well). (I changed it from the Phabricator revision's title, which was "[clangd] WIP: fix several bugs relating

[clang] [clang-tools-extra] [llvm] [clangd] Avoid bogus error about recursive inclusion (PR #95200)

2024-06-11 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 converted_to_draft https://github.com/llvm/llvm-project/pull/95200 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [clangd] Avoid bogus error about recursive inclusion (PR #95200)

2024-06-11 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: Converted to a draft because, as mentioned in https://github.com/clangd/clangd/issues/337#issuecomment-2162175454, the patch doesn't seem to actually fix the issue it's supposed to fix. https://github.com/llvm/llvm-project/pull/95200 __

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-15 Thread Nathan Ridge via cfe-commits
@@ -1637,6 +1678,144 @@ TEST(TypeHints, SubstTemplateParameterAliases) { ExpectedHint{": static_vector", "vector_name"}); } +template +void assertTypeLinkHints(StringRef Code, StringRef HintRange, + Labels... ExpectedLabels) { +

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Nathan Ridge via cfe-commits
@@ -372,6 +374,292 @@ maybeDropCxxExplicitObjectParameters(ArrayRef Params) { return Params; } +class TypeInlayHintLabelPartBuilder +: public TypeVisitor { + QualType CurrentType; + NestedNameSpecifier *CurrentNestedNameSpecifier; + ASTContext &Context; + StringRef M

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Nathan Ridge via cfe-commits
@@ -174,6 +175,29 @@ SourceLocation nameLocation(const clang::Decl &D, const SourceManager &SM) { return SM.getExpansionLoc(L); } +// Expects Loc to be a SpellingLocation, will bail out otherwise as it can't HighCommander4 wrote: nit: please move the comme

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Nathan Ridge via cfe-commits
@@ -372,6 +374,292 @@ maybeDropCxxExplicitObjectParameters(ArrayRef Params) { return Params; } +class TypeInlayHintLabelPartBuilder +: public TypeVisitor { + QualType CurrentType; + NestedNameSpecifier *CurrentNestedNameSpecifier; + ASTContext &Context; + StringRef M

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Nathan Ridge via cfe-commits
@@ -1005,14 +1332,22 @@ class InlayHintVisitor : public RecursiveASTVisitor { // The sugared type is more useful in some cases, and the canonical // type in other cases. auto Desugared = maybeDesugar(AST, T); -std::string TypeName = Desugared.getAsString(TypeHi

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 edited https://github.com/llvm/llvm-project/pull/86629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Nathan Ridge via cfe-commits
@@ -372,6 +374,292 @@ maybeDropCxxExplicitObjectParameters(ArrayRef Params) { return Params; } +class TypeInlayHintLabelPartBuilder HighCommander4 wrote: suggestion for shorter name: `TypeHintBuilder` https://github.com/llvm/llvm-project/pull/86629 ___

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Nathan Ridge via cfe-commits
@@ -1005,14 +1332,22 @@ class InlayHintVisitor : public RecursiveASTVisitor { // The sugared type is more useful in some cases, and the canonical // type in other cases. auto Desugared = maybeDesugar(AST, T); -std::string TypeName = Desugared.getAsString(TypeHi

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Nathan Ridge via cfe-commits
@@ -372,6 +374,292 @@ maybeDropCxxExplicitObjectParameters(ArrayRef Params) { return Params; } +class TypeInlayHintLabelPartBuilder +: public TypeVisitor { + QualType CurrentType; + NestedNameSpecifier *CurrentNestedNameSpecifier; + ASTContext &Context; + StringRef M

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Nathan Ridge via cfe-commits
@@ -372,6 +374,292 @@ maybeDropCxxExplicitObjectParameters(ArrayRef Params) { return Params; } +class TypeInlayHintLabelPartBuilder +: public TypeVisitor { + QualType CurrentType; + NestedNameSpecifier *CurrentNestedNameSpecifier; + ASTContext &Context; + StringRef M

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Nathan Ridge via cfe-commits
@@ -372,6 +374,292 @@ maybeDropCxxExplicitObjectParameters(ArrayRef Params) { return Params; } +class TypeInlayHintLabelPartBuilder +: public TypeVisitor { + QualType CurrentType; + NestedNameSpecifier *CurrentNestedNameSpecifier; + ASTContext &Context; + StringRef M

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Nathan Ridge via cfe-commits
@@ -1005,14 +1332,22 @@ class InlayHintVisitor : public RecursiveASTVisitor { // The sugared type is more useful in some cases, and the canonical // type in other cases. auto Desugared = maybeDesugar(AST, T); -std::string TypeName = Desugared.getAsString(TypeHi

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 requested changes to this pull request. Thanks for the updated patch, this generally looks very nice! It's a bit unfortunate that we have to reimplement parts of type printing like handling qualifiers and pointers/references. I wouldn't be surprised if we get

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Nathan Ridge via cfe-commits
@@ -372,6 +374,292 @@ maybeDropCxxExplicitObjectParameters(ArrayRef Params) { return Params; } +class TypeInlayHintLabelPartBuilder +: public TypeVisitor { + QualType CurrentType; + NestedNameSpecifier *CurrentNestedNameSpecifier; + ASTContext &Context; + StringRef M

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Nathan Ridge via cfe-commits
@@ -372,6 +374,292 @@ maybeDropCxxExplicitObjectParameters(ArrayRef Params) { return Params; } +class TypeInlayHintLabelPartBuilder +: public TypeVisitor { + QualType CurrentType; + NestedNameSpecifier *CurrentNestedNameSpecifier; + ASTContext &Context; + StringRef M

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Nathan Ridge via cfe-commits
@@ -372,6 +374,292 @@ maybeDropCxxExplicitObjectParameters(ArrayRef Params) { return Params; } +class TypeInlayHintLabelPartBuilder +: public TypeVisitor { + QualType CurrentType; + NestedNameSpecifier *CurrentNestedNameSpecifier; + ASTContext &Context; + StringRef M

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Nathan Ridge via cfe-commits
@@ -1637,6 +1678,168 @@ TEST(TypeHints, SubstTemplateParameterAliases) { ExpectedHint{": static_vector", "vector_name"}); } +template +void assertTypeLinkHints(StringRef Code, StringRef HintRange, + Labels... ExpectedLabels) { +

[clang-tools-extra] [clangd] Add config option to allow detection of unused system headers (PR #87208)

2024-05-28 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: Since the patch is approved, and as far as I can tell there aren't any comments remaining to be addressed, I will go ahead and merge this. https://github.com/llvm/llvm-project/pull/87208 ___ cfe-commits mailing list cfe-commits@l

[clang-tools-extra] [clangd] Add config option to allow detection of unused system headers (PR #87208)

2024-05-28 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: @vvd170501 I need to specify a commit message when merging. Github offers the PR description by default, but it seems slightly out of date (and some of it seems unnecessary). I would like to revise it as follows, could you look it over please: ``` [clangd] Add config opt

[clang-tools-extra] [clangd] Add config option to allow detection of unused system headers (PR #87208)

2024-05-29 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 closed https://github.com/llvm/llvm-project/pull/87208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add config option to allow detection of unused system headers (PR #87208)

2024-05-29 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > @HighCommander4, overall it looks good, but I'd replace "enables > include-cleaner checks" with "enables unused include check", because the > option doesn't affect missing include check. Thanks, revised and merged. https://github.com/llvm/llvm-project/pull/87208 __

[clang] [clang][Sema] Improve error recovery for id-expressions referencing invalid decls (PR #81662)

2024-04-14 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > The failures are related to new diagnostics that are issued as a side effect > of running additional checks in BuildDeclarationNameExpr(). A closer investigation has revealed that this diagnosis wasn't quite accurate. The three `SemaCXX` failures were not in fact caused

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-14 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/88645 >From 97170ed63643832f305254ba1788b99f90f9330d Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sun, 14 Apr 2024 02:41:48 -0400 Subject: [PATCH] [clang][Sema] Preserve the initializer of invalid VarDecls

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-14 Thread Nathan Ridge via cfe-commits
@@ -13435,8 +13435,7 @@ void Sema::checkNonTrivialCUnion(QualType QT, SourceLocation Loc, void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { // If there is no declaration, there was an error parsing it. Just ignore // the initializer. - if (!R

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-14 Thread Nathan Ridge via cfe-commits
@@ -13456,6 +13455,14 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { return; } + if (VDecl->isInvalidDecl()) { +CorrectDelayedTyposInExpr(Init, VDecl); +VDecl->setInit( +CreateRecoveryExpr(Init->getBeginLoc(), Init->ge

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-14 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > Thanks for the improvement! > > Can you also add a test case? Thanks for the feedback! I added a new test case. However, the patch currently fails two existing test cases: Clang :: Parser/cxx-class.cpp Clang :: SemaCXX/cxx1z-init-statement.cpp I will leave the PR

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-15 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/88645 >From 07424d8ee99fc418d071960bbdd4185564025139 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sun, 14 Apr 2024 02:41:48 -0400 Subject: [PATCH] [clang][Sema] Preserve the initializer of invalid VarDecls

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-15 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > I added a new test case. However, the patch currently fails two existing test > cases: > > Clang :: Parser/cxx-class.cpp > Clang :: SemaCXX/cxx1z-init-statement.cpp > > I will leave the PR as a Draft while I investigate these failures. The latest version of the patch f

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-15 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 ready_for_review https://github.com/llvm/llvm-project/pull/88645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-15 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/88645 >From b43d8ddf8846db8a77d01c9fb2d246a0d0ba2ab2 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sun, 14 Apr 2024 02:41:48 -0400 Subject: [PATCH] [clang][Sema] Preserve the initializer of invalid VarDecls

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-04-18 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: Sorry I haven't had a chance to look at this yet. I've been busy with another project, and will continue to be for another week or so. I hope to look at this soon! https://github.com/llvm/llvm-project/pull/86629 ___ cfe-commits

[clang-tools-extra] [clangd] Add config option to allow detection of unused system headers (PR #87208)

2024-04-20 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > @HighCommander4 Ping. Could you review this PR or suggest other reviewers, > please? I'm not very familiar with include-cleaner, but I added some reviewers who are. https://github.com/llvm/llvm-project/pull/87208 ___ cfe-commi

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-21 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 created https://github.com/llvm/llvm-project/pull/89557 Fixes https://github.com/clangd/clangd/issues/959 >From d98c95bf213f0c6e81a46a9e37d376b855bb4867 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sun, 21 Apr 2024 20:30:16 -0400 Subject: [PATCH] [clangd]

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-21 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 ready_for_review https://github.com/llvm/llvm-project/pull/89557 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-21 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: A few things I would appreciate feedback on: 1. I know a [previous comment on the bug](https://github.com/clangd/clangd/issues/959#issuecomment-998927030) stated "We don't show bodies of classes/enums/functions etc by policy", but can we consider changing this policy in

[clang] [clang-tools-extra] [clangd] Show struct members when hovering over a typedef (PR #89570)

2024-04-21 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 created https://github.com/llvm/llvm-project/pull/89570 Fixes https://github.com/clangd/clangd/issues/2020 >From d98c95bf213f0c6e81a46a9e37d376b855bb4867 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sun, 21 Apr 2024 20:30:16 -0400 Subject: [PATCH 1/2] [cl

[clang] [clang-tools-extra] [clangd] Show struct members when hovering over a typedef (PR #89570)

2024-04-21 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: (This builds on https://github.com/llvm/llvm-project/pull/89557 and the commit view shows both commits. I still need to figure out how to do proper stacked PRs...) https://github.com/llvm/llvm-project/pull/89570 ___ cfe-commits

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-21 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: @mizvekov does the updated patch look reasonable to you? https://github.com/llvm/llvm-project/pull/88645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-22 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > what about showing this kind of "summary" only when hovering over the > declaration of the symbol, rather than references? Did you mean the other way around (references and not declaration, since when you're at the declaration you're likely already looking at the fields

[clang-tools-extra] [clangd] fix crash in include cleaner (PR #99514)

2024-07-18 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: Is there a bug report this is fixing? Or a test case? https://github.com/llvm/llvm-project/pull/99514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-23 Thread Nathan Ridge via cfe-commits
@@ -13435,16 +13435,18 @@ void Sema::checkNonTrivialCUnion(QualType QT, SourceLocation Loc, void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { // If there is no declaration, there was an error parsing it. Just ignore // the initializer. - if (

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-23 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 edited https://github.com/llvm/llvm-project/pull/88645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-23 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/88645 >From c24e79da57fc69d2f353a5533a3cc26313301a71 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sun, 14 Apr 2024 02:41:48 -0400 Subject: [PATCH] [clang][Sema] Preserve the initializer of invalid VarDecls

[clang] [clang][Sema] Improve error recovery for id-expressions referencing invalid decls (PR #81662)

2024-04-23 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/81662 >From 480cabcfeb42542746026bba753b4170e08bb8ae Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Tue, 13 Feb 2024 12:26:17 -0500 Subject: [PATCH] [clang][Sema] Improve error recovery for id-expressions re

[clang] [clang][Sema] Improve error recovery for id-expressions referencing invalid decls (PR #81662)

2024-04-23 Thread Nathan Ridge via cfe-commits
@@ -3453,6 +3453,10 @@ ExprResult Sema::BuildDeclarationNameExpr(const CXXScopeSpec &SS, NeedsADL, R.isOverloadedResult(), R.begin(), R.end()); + if (ULE && R.isSingleResult() && R.getFoundDecl()->isInvali

[clang] [clang][Sema] Improve error recovery for id-expressions referencing invalid decls (PR #81662)

2024-04-23 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: (OpenMP failure still remains to be fixed.) https://github.com/llvm/llvm-project/pull/81662 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-23 Thread Nathan Ridge via cfe-commits
@@ -474,6 +477,17 @@ void DeclPrinter::VisitDeclContext(DeclContext *DC, bool Indent) { for (DeclContext::decl_iterator D = DC->decls_begin(), DEnd = DC->decls_end(); D != DEnd; ++D) { +// Print enum members and public struct fields when +// PrintTagTypeCont

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-23 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > > 3. Regarding the implementation approach, is it fine to add a flag to > > `PrintingPolicy` (which is a clang utility class used in a variety of > > places) for a clangd-specific use case like this? I did it this way because > > the alternative seemed to involve duplic

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-23 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > I have a few questions: > >1. Do we want an RFC in discourse for the changes in `DeclPrinter`? An RFC might be overkill, but asking for review from a clang code owner for changes to an interface such as `PrintingPolicy` or `PrintingCallbacks` is probably a good ide

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-23 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: I'm planning to revise the patch to make the following changes: 1. Put the new behaviour behind a config option (I'm thinking `Hover` --> `ShowFields`) 2. Add C language mode tests 3. Use `PrintingCallbacks` instead of a `PrintingPolicy` flag https://github.com/llvm/ll

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-23 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 converted_to_draft https://github.com/llvm/llvm-project/pull/89557 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-24 Thread Nathan Ridge via cfe-commits
@@ -13435,16 +13435,18 @@ void Sema::checkNonTrivialCUnion(QualType QT, SourceLocation Loc, void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { // If there is no declaration, there was an error parsing it. Just ignore // the initializer. - if (

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-24 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/88645 >From d8236b6a2feb27538fc131c30768d2247b7b86cb Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sun, 14 Apr 2024 02:41:48 -0400 Subject: [PATCH] [clang][Sema] Preserve the initializer of invalid VarDecls

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-24 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 closed https://github.com/llvm/llvm-project/pull/88645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Show struct members when hovering over a typedef (PR #89570)

2024-04-25 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/89570 >From 44aba390954c7b551ed7102e8e7b4209207c0d87 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Mon, 22 Apr 2024 02:24:14 -0400 Subject: [PATCH] [clangd] Show definition of underlying struct when hovering

[clang-tools-extra] [clangd] Show definition of underlying struct when hovering over a typedef (PR #89570)

2024-04-25 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 edited https://github.com/llvm/llvm-project/pull/89570 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Show definition of underlying struct when hovering over a typedef (PR #89570)

2024-04-25 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: Updated patch with the following changes: * Decoupled from https://github.com/clangd/clangd/issues/959 * Handle the case of multiple layers of typedefs, and add tests for this case * Add C language specific tests https://github.com/llvm/llvm-project/pull/89570 _

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-25 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/89557 >From fcb2ac4c68554d9c708b3db779b5570ff94725e8 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sun, 21 Apr 2024 20:30:16 -0400 Subject: [PATCH] [clangd] Show struct fields and enum members in hovers Fix

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-25 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 ready_for_review https://github.com/llvm/llvm-project/pull/89557 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-25 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > I'm planning to revise the patch to make the following changes: > >1. Put the new behaviour behind a config option (I'm thinking `Hover` --> > `ShowFields`) >2. Add C language mode tests >3. Use `PrintingCallbacks` instead of a `PrintingPolicy` flag These ch

[clang] [clang][Sema] Improve error recovery for id-expressions referencing invalid decls (PR #81662)

2024-04-25 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: Here is a reduced testcase for the OpenMP test failure: ```c++ #pragma omp declare target static long double ld_return1e() { return 0; } void external() { void *p1 = reinterpret_cast(&ld_return1e); } #pragma omp end declare target ``` When built with the following com

[clang-tools-extra] [clangd] Expand response files before CDB interpolation (PR #75753)

2024-04-27 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: @twmht To my knowledge, clang and clangd have only ever supported the `@file.rsp` response file syntax. The commands in the linked thread use the `--options-file file.rsp` syntax, which clang and clangd do not support. https://github.com/clangd/vscode-clangd/issues/592 i

[clang-tools-extra] [clangd] Do not collect macros when clang-tidy checks call into the preprocessor (PR #106329)

2024-08-27 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 created https://github.com/llvm/llvm-project/pull/106329 Fixes https://github.com/llvm/llvm-project/issues/99617 >From c5b3ae9c2cad6a0b0ada0ebb6adca117a3bfa012 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Tue, 27 Aug 2024 22:50:42 -0400 Subject: [PATCH] [

[clang-tools-extra] [clangd] Do not collect macros when clang-tidy checks call into the preprocessor (PR #106329)

2024-08-27 Thread Nathan Ridge via cfe-commits
@@ -702,6 +704,10 @@ ParsedAST::build(llvm::StringRef Filename, const ParseInputs &Inputs, log("Execute() failed when building AST for {0}: {1}", MainInput.getFile(), toString(std::move(Err))); + // Disable the macro collector for the remainder of this function,

[clang-tools-extra] [clangd] Do not collect macros when clang-tidy checks call into the preprocessor (PR #106329)

2024-08-28 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 closed https://github.com/llvm/llvm-project/pull/106329 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Do not collect macros when clang-tidy checks call into the preprocessor (PR #106329)

2024-08-28 Thread Nathan Ridge via cfe-commits
@@ -702,6 +704,10 @@ ParsedAST::build(llvm::StringRef Filename, const ParseInputs &Inputs, log("Execute() failed when building AST for {0}: {1}", MainInput.getFile(), toString(std::move(Err))); + // Disable the macro collector for the remainder of this function,

[clang-tools-extra] [clangd] Update TidyFastChecks for release/19.x (PR #106354)

2024-08-30 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 approved this pull request. https://github.com/llvm/llvm-project/pull/106354 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-09-02 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 edited https://github.com/llvm/llvm-project/pull/95712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-09-02 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 requested changes to this pull request. Apologies for the slow response time, it's been quite a busy summer. High-level feedback: * Let's definitely split the default arguments part from the lambda captures part. Even if we decide we want both, it helps to hav

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-09-02 Thread Nathan Ridge via cfe-commits
@@ -1681,6 +1681,21 @@ enum class InlayHintKind { /// This is a clangd extension. BlockEnd = 4, + /// An inlay hint that is for a variable captured implicitly in a lambda. + /// + /// An example of parameter hint for implicit lambda captures: + ///[&^] { return A;

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-09-02 Thread Nathan Ridge via cfe-commits
@@ -372,6 +383,38 @@ maybeDropCxxExplicitObjectParameters(ArrayRef Params) { return Params; } +llvm::StringRef getLambdaCaptureName(const LambdaCapture &Capture) { + switch (Capture.getCaptureKind()) { + case LCK_This: + case LCK_StarThis: +return llvm::StringRef{"thi

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-09-02 Thread Nathan Ridge via cfe-commits
@@ -755,12 +812,33 @@ class InlayHintVisitor : public RecursiveASTVisitor { bool NameHint = shouldHintName(Args[I], Name); bool ReferenceHint = shouldHintReference(Params[I], ForwardedParams[I]); + bool IsDefault = isa(Args[I]); HighCommander

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-09-02 Thread Nathan Ridge via cfe-commits
@@ -709,7 +762,8 @@ class InlayHintVisitor : public RecursiveASTVisitor { private: using NameVec = SmallVector; - void processCall(Callee Callee, llvm::ArrayRef Args) { + void processCall(Callee Callee, SourceRange LParenOrBraceRange, HighCommander4 wrote

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-09-02 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 edited https://github.com/llvm/llvm-project/pull/95712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] Don't preserve the typo expr in the recovery expr for invalid VarDecls (PR #90948)

2024-05-03 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 approved this pull request. Thanks for catching this! https://github.com/llvm/llvm-project/pull/90948 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-05-04 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > Bump @HighCommander4 - did you get a chance to review this? Hi @torshepherd! Sorry for not being more responsive on this. I haven't had as much time as I'd like to spend on clangd reviews recently, and certainly not enough to keep up with the volume of review requests t

[clang-tools-extra] [clangd] Support callHierarchy/outgoingCalls (PR #91191)

2024-05-06 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: If I'm understanding correctly, the implementation approach in this PR only finds callees in the current translation unit. The approach in #77556 uses the project's index to find callees across translation unit boundaries. Regarding reviews: yes, it seems quite unfortuna

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-05-21 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 edited https://github.com/llvm/llvm-project/pull/86629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-05-21 Thread Nathan Ridge via cfe-commits
@@ -1637,6 +1678,144 @@ TEST(TypeHints, SubstTemplateParameterAliases) { ExpectedHint{": static_vector", "vector_name"}); } +template +void assertTypeLinkHints(StringRef Code, StringRef HintRange, + Labels... ExpectedLabels) { +

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-05-21 Thread Nathan Ridge via cfe-commits
@@ -73,6 +86,34 @@ MATCHER_P2(HintMatcher, Expected, Code, llvm::to_string(Expected)) { return true; } +MATCHER_P2(HintLabelPieceMatcher, Expected, Code, llvm::to_string(Expected)) { + llvm::StringRef ExpectedView(Expected.Label); + std::string ResultLabel = arg.value; +

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-05-21 Thread Nathan Ridge via cfe-commits
@@ -1637,6 +1678,144 @@ TEST(TypeHints, SubstTemplateParameterAliases) { ExpectedHint{": static_vector", "vector_name"}); } +template +void assertTypeLinkHints(StringRef Code, StringRef HintRange, + Labels... ExpectedLabels) { +

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-05-21 Thread Nathan Ridge via cfe-commits
@@ -1637,6 +1678,144 @@ TEST(TypeHints, SubstTemplateParameterAliases) { ExpectedHint{": static_vector", "vector_name"}); } +template +void assertTypeLinkHints(StringRef Code, StringRef HintRange, + Labels... ExpectedLabels) { +

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-05-21 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 commented: Apologies for the long wait. I'm excited about this enhancement, thanks for working on it! I've only looked at the tests so far. Will look at the implementation in the coming days but wanted to share my thoughts so far. https://github.com/llvm/llvm

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-05-21 Thread Nathan Ridge via cfe-commits
@@ -55,6 +55,19 @@ struct ExpectedHint { } }; +struct ExpectedHintLabelPiece { + std::string Label; + std::optional PointsTo = std::nullopt; HighCommander4 wrote: It's not immediately clear what this stores, let's add: ``` // Stores the name of a range a

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-05-21 Thread Nathan Ridge via cfe-commits
@@ -1637,6 +1678,144 @@ TEST(TypeHints, SubstTemplateParameterAliases) { ExpectedHint{": static_vector", "vector_name"}); } +template +void assertTypeLinkHints(StringRef Code, StringRef HintRange, + Labels... ExpectedLabels) { +

[clang] [clang][CodeComplete] Recurse into the subexpression of deref operator in getApproximateType (PR #93404)

2024-05-26 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 edited https://github.com/llvm/llvm-project/pull/93404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeComplete] Recurse into the subexpression of deref operator in getApproximateType (PR #93404)

2024-05-26 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 approved this pull request. Thank you! Looks good with one suggested change. https://github.com/llvm/llvm-project/pull/93404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [clang][CodeComplete] Recurse into the subexpression of deref operator in getApproximateType (PR #93404)

2024-05-26 Thread Nathan Ridge via cfe-commits
@@ -5680,8 +5680,16 @@ QualType getApproximateType(const Expr *E) { } } if (const auto *UO = llvm::dyn_cast(E)) { -if (UO->getOpcode() == UnaryOperatorKind::UO_Deref) - return UO->getSubExpr()->getType()->getPointeeType(); +if (UO->getOpcode() == UnaryOpera

[clang-tools-extra] ddfe13e - [clangd] Produce semantic token for name referring to UnresolvedUsingValueDecl

2021-04-25 Thread Nathan Ridge via cfe-commits
Author: Nathan Ridge Date: 2021-04-25T16:43:58-04:00 New Revision: ddfe13e757cb72c056cba8d889d6cb8ee69f1afa URL: https://github.com/llvm/llvm-project/commit/ddfe13e757cb72c056cba8d889d6cb8ee69f1afa DIFF: https://github.com/llvm/llvm-project/commit/ddfe13e757cb72c056cba8d889d6cb8ee69f1afa.diff

[clang-tools-extra] d941863 - [clangd] Use HeuristicResolver to produce a better semantic token for name referring to UnresolvedUsingValueDecl

2021-04-25 Thread Nathan Ridge via cfe-commits
Author: Nathan Ridge Date: 2021-04-25T16:45:04-04:00 New Revision: d941863de2becb3d8d2e00676fc7125974934c7f URL: https://github.com/llvm/llvm-project/commit/d941863de2becb3d8d2e00676fc7125974934c7f DIFF: https://github.com/llvm/llvm-project/commit/d941863de2becb3d8d2e00676fc7125974934c7f.diff

[clang-tools-extra] 753b247 - [clangd] Omit parameter hint if parameter name comment is present

2021-04-25 Thread Nathan Ridge via cfe-commits
Author: Nathan Ridge Date: 2021-04-25T19:20:10-04:00 New Revision: 753b247d71d7e74dd6998735848a2d9e0b6317de URL: https://github.com/llvm/llvm-project/commit/753b247d71d7e74dd6998735848a2d9e0b6317de DIFF: https://github.com/llvm/llvm-project/commit/753b247d71d7e74dd6998735848a2d9e0b6317de.diff

[clang-tools-extra] 6f6cf2d - [clangd] Omit parameter hint for setter functions

2021-04-25 Thread Nathan Ridge via cfe-commits
Author: Nathan Ridge Date: 2021-04-25T19:20:12-04:00 New Revision: 6f6cf2da8d9453f2bd57978be1e5d0765ea50a36 URL: https://github.com/llvm/llvm-project/commit/6f6cf2da8d9453f2bd57978be1e5d0765ea50a36 DIFF: https://github.com/llvm/llvm-project/commit/6f6cf2da8d9453f2bd57978be1e5d0765ea50a36.diff

[clang-tools-extra] c624e70 - [clangd] Rename HeuristicResolver::resolveCallExpr() to resolveTypeOfCallExpr()

2021-04-25 Thread Nathan Ridge via cfe-commits
Author: Nathan Ridge Date: 2021-04-25T19:20:14-04:00 New Revision: c624e701491c320cf5c662006082a8e956c30e8d URL: https://github.com/llvm/llvm-project/commit/c624e701491c320cf5c662006082a8e956c30e8d DIFF: https://github.com/llvm/llvm-project/commit/c624e701491c320cf5c662006082a8e956c30e8d.diff

[clang-tools-extra] 43cbf2b - [clangd] Avoid including HeuristicResolver.h from ParsedAST.h

2021-05-02 Thread Nathan Ridge via cfe-commits
Author: Nathan Ridge Date: 2021-05-03T00:55:22-04:00 New Revision: 43cbf2bb84eb319ff3e95b3316344ece35ea59b1 URL: https://github.com/llvm/llvm-project/commit/43cbf2bb84eb319ff3e95b3316344ece35ea59b1 DIFF: https://github.com/llvm/llvm-project/commit/43cbf2bb84eb319ff3e95b3316344ece35ea59b1.diff

[clang-tools-extra] cea736e - [clangd] Hide inlay hints capability behind a command-line flag

2021-05-02 Thread Nathan Ridge via cfe-commits
Author: Nathan Ridge Date: 2021-05-03T01:01:57-04:00 New Revision: cea736e5b8a48065007a591d71699b53c04d95b3 URL: https://github.com/llvm/llvm-project/commit/cea736e5b8a48065007a591d71699b53c04d95b3 DIFF: https://github.com/llvm/llvm-project/commit/cea736e5b8a48065007a591d71699b53c04d95b3.diff

[clang-tools-extra] 1f1fb5e - [clangd] Fix build error in SemanticHighlighting.cpp

2021-05-02 Thread Nathan Ridge via cfe-commits
Author: Nathan Ridge Date: 2021-05-03T01:19:07-04:00 New Revision: 1f1fb5e8e6b214f7f13a4e4731b6d6add33508aa URL: https://github.com/llvm/llvm-project/commit/1f1fb5e8e6b214f7f13a4e4731b6d6add33508aa DIFF: https://github.com/llvm/llvm-project/commit/1f1fb5e8e6b214f7f13a4e4731b6d6add33508aa.diff

[clang-tools-extra] 3504e50 - [clangd] Fix test failure in initialize-params.test

2021-05-02 Thread Nathan Ridge via cfe-commits
Author: Nathan Ridge Date: 2021-05-03T01:37:09-04:00 New Revision: 3504e50b6db5ec71cf0df5a14a2576c1003614c9 URL: https://github.com/llvm/llvm-project/commit/3504e50b6db5ec71cf0df5a14a2576c1003614c9 DIFF: https://github.com/llvm/llvm-project/commit/3504e50b6db5ec71cf0df5a14a2576c1003614c9.diff

<    1   2   3   4   5   6   7   8   9   10   >