[tools] go/ast/inspector: add Cursor.ParentEdge{Kind,Index} methods

0 views
Skip to first unread message

Alan Donovan (Gerrit)

unread,
Feb 9, 2026, 12:22:16 PMFeb 9
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Madeline Kalil, Go LUCI, golang-co...@googlegroups.com

Alan Donovan submitted the change

Change information

Commit message:
go/ast/inspector: add Cursor.ParentEdge{Kind,Index} methods

These methods return just one or the other component of ParentEdge,
making them more convenient to use than ParentEdge in most cases,
obviating astutil.IsChildOf.

Also, fix some doc links, and use plain "valid" instead
of [Cursor.Valid] in adjectival contexts; the meaning is clear.

Fixes golang/go#77195
Change-Id: Id9521a67cda78958ed799874a38ff3f039e4a564
Reviewed-by: Madeline Kalil <mka...@google.com>
Files:
  • M go/analysis/passes/inline/inline.go
  • M go/analysis/passes/modernize/errorsastype.go
  • M go/analysis/passes/modernize/minmax.go
  • M go/analysis/passes/modernize/modernize.go
  • M go/analysis/passes/modernize/rangeint.go
  • M go/analysis/passes/modernize/reflect.go
  • M go/analysis/passes/modernize/stditerators.go
  • M go/analysis/passes/modernize/stringsbuilder.go
  • M go/analysis/passes/modernize/stringscut.go
  • M go/analysis/passes/modernize/unsafefuncs.go
  • M go/ast/inspector/cursor.go
  • M gopls/internal/analysis/maprange/maprange.go
  • M gopls/internal/golang/codeaction.go
  • M gopls/internal/golang/extract.go
  • M gopls/internal/golang/highlight.go
  • M gopls/internal/golang/implementation.go
  • M gopls/internal/golang/inline.go
  • M gopls/internal/golang/lines.go
  • M gopls/internal/golang/references.go
  • M gopls/internal/golang/stubmethods/stubmethods.go
  • M gopls/internal/golang/type_definition.go
  • M gopls/internal/golang/undeclared.go
  • M gopls/internal/util/typesutil/typesutil.go
  • M internal/astutil/util.go
  • M internal/refactor/delete.go
  • M internal/typesinternal/typeindex/typeindex.go
Change size: M
Delta: 26 files changed, 70 insertions(+), 77 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Madeline Kalil
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: tools
Gerrit-Branch: master
Gerrit-Change-Id: Id9521a67cda78958ed799874a38ff3f039e4a564
Gerrit-Change-Number: 740280
Gerrit-PatchSet: 6
Gerrit-Owner: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Madeline Kalil <mka...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages