You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Tool finds and lists all references to (uses of) the given entity.
50
+
Entity can be function, struct, or global variable.
51
+
If can be used to find all calls or other uses of the given function.
47
52
`),
48
53
}
49
54
@@ -95,8 +100,8 @@ type indexEntity struct {
95
100
96
101
// nolint: lll
97
102
typedefCommentArgsstruct {
98
-
SourceFilestring`jsonschema:"Source file path that references the entity. It helps to restrict scope of the search, if there are different definitions with the same name in different source files."`
99
-
Namestring`jsonschema:"Name of the entity of interest."`
103
+
ContextFilestring`jsonschema:"Source file path that references the entity. It helps to restrict scope of the search, if there are different definitions with the same name in different source files."`
104
+
Namestring`jsonschema:"Name of the entity of interest."`
100
105
}
101
106
102
107
typedefCommentResultstruct {
@@ -106,7 +111,7 @@ type defCommentResult struct {
106
111
107
112
// nolint: lll
108
113
typedefSourceArgsstruct {
109
-
SourceFilestring`jsonschema:"Source file path that references the entity. It helps to restrict scope of the search, if there are different definitions with the same name in different source files."`
114
+
ContextFilestring`jsonschema:"Source file path that references the entity. It helps to restrict scope of the search, if there are different definitions with the same name in different source files."`
110
115
Namestring`jsonschema:"Name of the entity of interest."`
111
116
IncludeLinesbool`jsonschema:"Whether to include line numbers in the output or not. Line numbers may distract you, so ask for them only if you need to match lines elsewhere with the source code."`
ContextFilestring`jsonschema:"Source file path that references the entity. It helps to restrict scope of the search, if there are different definitions with the same name in different source files." json:",omitempty"`
213
+
Namestring`jsonschema:"Name of the entity of interest."`
214
+
SourceTreePrefixstring`jsonschema:"Prefix of the sources tree where to search for references. Can be used to restrict search to e.g. net/ipv4/. Pass an empty string to find all references." json:",omitempty"`
215
+
IncludeSnippetLinesuint`jsonschema:"If set to non-0, output will include source code snippets with that many lines of context. If set to 0, no source snippets will be included. Snippets only show the referencing entity, so to see e.g. whole referencing functions pass a large value, e.g. 10000" json:",omitempty"`
216
+
}
217
+
218
+
// nolint: lll
219
+
typefindReferencesResultstruct {
220
+
TruncatedOutputbool`jsonschema:"Set if there were too many references, and the output is truncated. If you get truncated output, you may try to either request w/o source code snippets by passing IncludeSnippetLines=0 (which has higher limit on the number of output references), or restrict search to some prefix of the source tree with SourceTreePrefix argument."`
221
+
References []Reference`jsonschema:"List of requested references."`
222
+
}
223
+
224
+
typeReferencestruct {
225
+
ReferencingEntityKindstring`jsonschema:"Kind of the referencing entity (function, struct, etc)."`
226
+
ReferencingEntityNamestring`jsonschema:"Name of the referencing entity."`
227
+
ReferenceKindstring`jsonschema:"Kind of the reference (calls, takes-address, reads, writes-to, etc)."`
228
+
SourceFilestring`jsonschema:"Source file of the reference."`
229
+
SourceLineint`jsonschema:"Source line of the reference."`
230
+
SourceSnippetstring`jsonschema:"Surrounding code snippet, if requested." json:",omitempty"`
0 commit comments