Skip to content

Commit b30c11f

Browse files
docs: updated API reference
1 parent e022868 commit b30c11f

File tree

155 files changed

+2408
-2407
lines changed

Some content is hidden

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

155 files changed

+2408
-2407
lines changed

docs/api-reference/core/Argument.mdx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1119-L1127" />
115+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1116-L1124" />
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/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L637-L665" />
123+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L634-L662" />
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/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L487-L504" />
158+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L484-L501" />
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/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L398-L412" />
181+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L395-L409" />
182182

183183
<ParameterWrapper>
184184
<Parameter
@@ -201,7 +201,7 @@ Returns a list of string literals within this node's source that match any of th
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/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L939-L950" />
204+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L936-L947" />
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/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L909-L925" />
220+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L906-L922" />
221221

222222
<ParameterWrapper>
223223
<Parameter
@@ -240,7 +240,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl
240240

241241
### <span className="text-primary">insert_after</span>
242242
Inserts code after this node.
243-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L608-L634" />
243+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L605-L631" />
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/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L575-L605" />
284+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L572-L602" />
285285

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

323323
### <span className="text-primary">is_child_of</span>
324324
Checks if this node is a descendant of the given editable instance in the AST.
325-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1109-L1116" />
325+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1106-L1113" />
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">is_wrapped_in</span>
332332
Check if this node is contained another node of the given class
333-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1088-L1090" />
333+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1085-L1087" />
334334

335335

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

338338

339339
### <span className="text-primary">parent_of_type</span>
340340
Find the first ancestor of the node of the given type. Does not return itself
341-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1093-L1099" />
341+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1090-L1096" />
342342

343343

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

346346

347347
### <span className="text-primary">parent_of_types</span>
348348
Find the first ancestor of the node of the given type. Does not return itself
349-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1101-L1107" />
349+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1098-L1104" />
350350

351351

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

354354

355355
### <span className="text-primary">reduce_condition</span>
356356
Reduces an editable to the following condition
357-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1044-L1049" />
357+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1041-L1046" />
358358

359359

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

362362

363363
### <span className="text-primary">remove</span>
364364
Deletes this Node and its related extended nodes (e.g. decorators, comments).
365-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L687-L702" />
365+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L684-L699" />
366366

367367
<ParameterWrapper>
368368
<Parameter
@@ -408,7 +408,7 @@ Sets the name of an object and updates all its usages.
408408

409409
### <span className="text-primary">replace</span>
410410
Search and replace occurrences of text within this node's source and its extended nodes.
411-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L432-L456" />
411+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L429-L453" />
412412

413413
<ParameterWrapper>
414414
<Parameter
@@ -449,7 +449,7 @@ Search and replace occurrences of text within this node's source and its extende
449449

450450
### <span className="text-primary">search</span>
451451
Returns a list of all regex match of `regex_pattern`, similar to python's re.search().
452-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L520-L536" />
452+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L517-L533" />
453453

454454
<ParameterWrapper>
455455
<Parameter

docs/api-reference/core/Assignment.mdx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Insert a keyword in the appropriate place before this symbol if it doesn't alrea
149149

150150
### <span className="text-primary">ancestors</span>
151151
Find all ancestors of the node of the given type. Does not return itself
152-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1119-L1127" />
152+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1116-L1124" />
153153

154154

155155
<Return return_type={ <><span>list[</span> <a href="/api-reference/core/Editable" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Editable</a> <span>]</span></> } description=""/>
@@ -215,7 +215,7 @@ Replace the source of this node with new_src.
215215

216216
### <span className="text-primary">find</span>
217217
Find and return matching nodes or substrings within an Editable instance.
218-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L487-L504" />
218+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L484-L501" />
219219

220220
<ParameterWrapper>
221221
<Parameter
@@ -238,7 +238,7 @@ Find and return matching nodes or substrings within an Editable instance.
238238

239239
### <span className="text-primary">find_string_literals</span>
240240
Returns a list of string literals within this node's source that match any of the given
241-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L398-L412" />
241+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L395-L409" />
242242

243243
<ParameterWrapper>
244244
<Parameter
@@ -261,7 +261,7 @@ Returns a list of string literals within this node's source that match any of th
261261

262262
### <span className="text-primary">flag</span>
263263
Adds a visual flag comment to the end of this Editable's source text.
264-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L939-L950" />
264+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L936-L947" />
265265

266266

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

278278
### <span className="text-primary">get_variable_usages</span>
279279
Returns Editables for all TreeSitter nodes corresponding to instances of variable usage
280-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L909-L925" />
280+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L906-L922" />
281281

282282
<ParameterWrapper>
283283
<Parameter
@@ -300,7 +300,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl
300300

301301
### <span className="text-primary">insert_after</span>
302302
Inserts code after this node.
303-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L608-L634" />
303+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L605-L631" />
304304

305305
<ParameterWrapper>
306306
<Parameter
@@ -388,15 +388,15 @@ Inserts text before the current symbol node in the Abstract Syntax Tree.
388388

389389
### <span className="text-primary">is_child_of</span>
390390
Checks if this node is a descendant of the given editable instance in the AST.
391-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1109-L1116" />
391+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1106-L1113" />
392392

393393

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

396396

397397
### <span className="text-primary">is_wrapped_in</span>
398398
Check if this node is contained another node of the given class
399-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1088-L1090" />
399+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1085-L1087" />
400400

401401

402402
<Return return_type={ <code className="text-sm bg-gray-100 px-2 py-0.5 rounded">bool</code> } description=""/>
@@ -441,15 +441,15 @@ Moves the given symbol to a new file and updates its imports and references.
441441

442442
### <span className="text-primary">parent_of_type</span>
443443
Find the first ancestor of the node of the given type. Does not return itself
444-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1093-L1099" />
444+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1090-L1096" />
445445

446446

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

449449

450450
### <span className="text-primary">parent_of_types</span>
451451
Find the first ancestor of the node of the given type. Does not return itself
452-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1101-L1107" />
452+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L1098-L1104" />
453453

454454

455455
<Return return_type={ <><a href="/api-reference/core/Editable" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Editable</a> <span>| None</span></> } description=""/>
@@ -474,7 +474,7 @@ Simplifies an assignment expression by reducing it based on a boolean condition
474474

475475
### <span className="text-primary">remove</span>
476476
Deletes this Node and its related extended nodes (e.g. decorators, comments).
477-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L687-L702" />
477+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L684-L699" />
478478

479479
<ParameterWrapper>
480480
<Parameter
@@ -526,7 +526,7 @@ Renames a symbol and updates all its references in the codebase.
526526

527527
### <span className="text-primary">replace</span>
528528
Search and replace occurrences of text within this node's source and its extended nodes.
529-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L432-L456" />
529+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L429-L453" />
530530

531531
<ParameterWrapper>
532532
<Parameter
@@ -567,7 +567,7 @@ Search and replace occurrences of text within this node's source and its extende
567567

568568
### <span className="text-primary">search</span>
569569
Returns a list of all regex match of `regex_pattern`, similar to python's re.search().
570-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L520-L536" />
570+
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/interfaces/editable.py#L517-L533" />
571571

572572
<ParameterWrapper>
573573
<Parameter

0 commit comments

Comments
 (0)