aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/codesearch/database.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2026-01-19 15:31:50 +0100
committerDmitry Vyukov <dvyukov@google.com>2026-01-21 13:38:45 +0000
commitd720635adb8965149cd75a3da692d3a0480c36c9 (patch)
treed9896eabd70abd266028624702bc74609ba1c9e4 /pkg/codesearch/database.go
parent6984f21fcb77bdd034a489c0e552aa1d910e852f (diff)
pkg/codesearch: support searching for references
Extend codesearch clang tool to export info about function references (calls, takes-address-of). Add pkg/codesearch command find-references. Export find-references in pkg/aflow/tools/codesearcher to LLMs. Update #6469
Diffstat (limited to 'pkg/codesearch/database.go')
-rw-r--r--pkg/codesearch/database.go20
1 files changed, 14 insertions, 6 deletions
diff --git a/pkg/codesearch/database.go b/pkg/codesearch/database.go
index 4757935e9..499fc73cb 100644
--- a/pkg/codesearch/database.go
+++ b/pkg/codesearch/database.go
@@ -14,12 +14,20 @@ type Database struct {
}
type Definition struct {
- Kind string `json:"kind,omitempty"`
- Name string `json:"name,omitempty"`
- Type string `json:"type,omitempty"`
- IsStatic bool `json:"is_static,omitempty"`
- Body LineRange `json:"body,omitempty"`
- Comment LineRange `json:"comment,omitempty"`
+ Kind string `json:"kind,omitempty"`
+ Name string `json:"name,omitempty"`
+ Type string `json:"type,omitempty"`
+ IsStatic bool `json:"is_static,omitempty"`
+ Body LineRange `json:"body,omitempty"`
+ Comment LineRange `json:"comment,omitempty"`
+ Refs []Reference `json:"refs,omitempty"`
+}
+
+type Reference struct {
+ Kind string `json:"kind,omitempty"`
+ EntityKind string `json:"entity_kind,omitempty"`
+ Name string `json:"name,omitempty"`
+ Line int `json:"line,omitempty"`
}
type LineRange struct {