Skip to content

Commit f88da8f

Browse files
authored
Update Docs and System Prompts (#488)
# Motivation <!-- Why is this change necessary? --> # Content <!-- Please include a summary of the change --> # Testing <!-- How was the change tested? --> # Please check the following before marking your PR as ready for review - [ ] I have added tests for my changes - [ ] I have updated the documentation or added new documentation as needed
1 parent b448a81 commit f88da8f

File tree

160 files changed

+5049
-3269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+5049
-3269
lines changed

docs/api-reference/core/Argument.mdx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx';
1111
import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx';
1212
import {Attribute} from '/snippets/Attribute.mdx';
1313

14-
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/detached_symbols/argument.py#L30-L156" />
14+
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/detached_symbols/argument.py#L30-L163" />
1515

1616
### Inherits from
1717
[HasValue](/api-reference/core/HasValue), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable)
@@ -95,7 +95,7 @@ import {Attribute} from '/snippets/Attribute.mdx';
9595
<HorizontalDivider />
9696
### <span className="text-primary">add_keyword</span>
9797
Converts an unnamed argument to a named argument by adding a keyword.
98-
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/detached_symbols/argument.py#L105-L121" />
98+
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/detached_symbols/argument.py#L112-L128" />
9999

100100
<ParameterWrapper>
101101
<Parameter
@@ -112,15 +112,15 @@ Converts an unnamed argument to a named argument by adding a keyword.
112112

113113
### <span className="text-primary">ancestors</span>
114114
Find all ancestors of the node of the given type. Does not return itself
115-
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L1088-L1096" />
115+
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L1101-L1109" />
116116

117117

118118
<Return return_type={ <><span>list[</span> <a href="/api-reference/core/Editable" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Editable</a> <span>]</span></> } description=""/>
119119

120120

121121
### <span className="text-primary">edit</span>
122122
Replace the source of this `Editable` with `new_src`.
123-
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L632-L660" />
123+
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L637-L665" />
124124

125125
<ParameterWrapper>
126126
<Parameter
@@ -155,7 +155,7 @@ Replace the source of this `Editable` with `new_src`.
155155

156156
### <span className="text-primary">find</span>
157157
Find and return matching nodes or substrings within an Editable instance.
158-
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L482-L499" />
158+
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L487-L504" />
159159

160160
<ParameterWrapper>
161161
<Parameter
@@ -178,7 +178,7 @@ Find and return matching nodes or substrings within an Editable instance.
178178

179179
### <span className="text-primary">find_string_literals</span>
180180
Returns a list of string literals within this node's source that match any of the given
181-
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L394-L408" />
181+
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L398-L412" />
182182

183183
<ParameterWrapper>
184184
<Parameter
@@ -196,12 +196,12 @@ Returns a list of string literals within this node's source that match any of th
196196
</ParameterWrapper>
197197

198198

199-
<Return return_type={ <><span>list[</span> <a href="/api-reference/core/Editable" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Editable</a> <span>]</span></> } description="A list of Editable objects representing the matching string literals."/>
199+
<Return return_type={ <><span>list[</span> <a href="/api-reference/core/Editable" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Editable</a> <span>[</span> <a href="/api-reference/core/Argument" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Argument</a> <span>]]</span></> } description="A list of Editable objects representing the matching string literals."/>
200200

201201

202202
### <span className="text-primary">flag</span>
203203
Adds a visual flag comment to the end of this Editable's source text.
204-
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L926-L937" />
204+
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L939-L950" />
205205

206206

207207
<Return return_type={ <><span>CodeFlag[</span> <a href="/api-reference/core/Argument" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Argument</a> <span>]</span></> } description=""/>
@@ -217,7 +217,7 @@ Returns the name node of the object.
217217

218218
### <span className="text-primary">get_variable_usages</span>
219219
Returns Editables for all TreeSitter nodes corresponding to instances of variable usage
220-
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L902-L918" />
220+
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L909-L925" />
221221

222222
<ParameterWrapper>
223223
<Parameter
@@ -235,12 +235,12 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl
235235
</ParameterWrapper>
236236

237237

238-
<Return return_type={ <><span>list[</span> <a href="/api-reference/core/Editable" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Editable</a> <span>]</span></> } description="List of Editable objects representing variable usage nodes matching the given name."/>
238+
<Return return_type={ <><span>Sequence[</span> <a href="/api-reference/core/Editable" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Editable</a> <span>[</span> <a href="/api-reference/core/Argument" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Argument</a> <span>]]</span></> } description="List of Editable objects representing variable usage nodes matching the given name."/>
239239

240240

241241
### <span className="text-primary">insert_after</span>
242242
Inserts code after this node.
243-
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L603-L629" />
243+
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L608-L634" />
244244

245245
<ParameterWrapper>
246246
<Parameter
@@ -281,7 +281,7 @@ Inserts code after this node.
281281

282282
### <span className="text-primary">insert_before</span>
283283
Inserts text before this node's source with optional indentation and newline handling.
284-
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L570-L600" />
284+
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L575-L605" />
285285

286286
<ParameterWrapper>
287287
<Parameter
@@ -322,31 +322,31 @@ Inserts text before this node's source with optional indentation and newline han
322322

323323
### <span className="text-primary">is_wrapped_in</span>
324324
Check if this node is contained another node of the given class
325-
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L1074-L1076" />
325+
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L1087-L1089" />
326326

327327

328328
<Return return_type={ <code className="text-sm bg-gray-100 px-2 py-0.5 rounded">bool</code> } description=""/>
329329

330330

331331
### <span className="text-primary">parent_of_type</span>
332332
Find the first ancestor of the node of the given type. Does not return itself
333-
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L1079-L1085" />
333+
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L1092-L1098" />
334334

335335

336336
<Return return_type={ <><a href="/api-reference/core/Editable" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Editable</a> <span>| None</span></> } description=""/>
337337

338338

339339
### <span className="text-primary">reduce_condition</span>
340340
Reduces an editable to the following condition
341-
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L1030-L1035" />
341+
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L1043-L1048" />
342342

343343

344344
<Return return_type={ <code className="text-sm bg-gray-100 px-2 py-0.5 rounded">None</code> } description=""/>
345345

346346

347347
### <span className="text-primary">remove</span>
348348
Deletes this Node and its related extended nodes (e.g. decorators, comments).
349-
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L682-L697" />
349+
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L687-L702" />
350350

351351
<ParameterWrapper>
352352
<Parameter
@@ -392,7 +392,7 @@ Sets the name of an object and updates all its usages.
392392

393393
### <span className="text-primary">replace</span>
394394
Search and replace occurrences of text within this node's source and its extended nodes.
395-
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L427-L451" />
395+
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L432-L456" />
396396

397397
<ParameterWrapper>
398398
<Parameter
@@ -433,7 +433,7 @@ Search and replace occurrences of text within this node's source and its extende
433433

434434
### <span className="text-primary">search</span>
435435
Returns a list of all regex match of `regex_pattern`, similar to python's re.search().
436-
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L515-L531" />
436+
<GithubLinkNote link="https://github.com/codegen-sh/codegen-sdk/blob/develop/src/codegen/sdk/core/interfaces/editable.py#L520-L536" />
437437

438438
<ParameterWrapper>
439439
<Parameter

0 commit comments

Comments
 (0)