Skip to content

Commit 1f3cd1e

Browse files
committed
Minor change
1 parent 56946e0 commit 1f3cd1e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

grammar.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ module.exports = grammar({
177177
// ---
178178

179179
/**
180-
Syntax: (VARIABLE|FUNCTION|CLASS) "<name>" [OFFSET <offset>] FROM FILE "<path/to/file>"
180+
Syntax: (VARIABLE|FUNCTION|METHOD|CLASS) "<name>" [OFFSET <offset>] FROM FILE "<path/to/file>"
181181
Use cases: Specify an identifier in a given file.
182182
<params>
183183
- `<name>`: Identifies the name of a variable, function or class as the item of interest in the file.
@@ -256,7 +256,7 @@ module.exports = grammar({
256256
relpos_beforeafter: $ => field('relpos_beforeafter', seq(choice('BEFORE', 'AFTER'), $.marker)),
257257
/**
258258
relpos_inside: Points to inside `identifierMarker` (either the body's TOP or BOTTOM region). The reference indentation level is the body's.
259-
Syntax: INSIDE (FUNCTION|CLASS) "<name>" [OFFSET <offset>] (TOP|BOTTOM)
259+
Syntax: INSIDE (FUNCTION|METHOD|CLASS) "<name>" [OFFSET <offset>] (TOP|BOTTOM)
260260
Use cases: When inserting content either at the TOP or BOTTOM of a function or class body.
261261
Examples: <ul>
262262
<li>INSIDE FUNCTION my_function OFFSET 1 BOTTOM -- at the BOTTOM of the function body</li>
@@ -291,7 +291,8 @@ module.exports = grammar({
291291
region_field: $ => field('region', choice(PARAMS_DOC_DECORATORS_OR_TYPE_FIELD, BODY_OR_WHOLE, $.marker_or_segment)),
292292

293293
/**
294-
Field `offset`: Integer to identify how many matches to skip. *MANDATORY* iff there are 2 or more matching elements.
294+
offset_clause: When a reference is ambiguous (multiple matches exist for it), it must be disambiguated. Setting an OFFSET is a way to do that.
295+
Field `offset`: An int to set how many matches to skip.
295296
<examples>
296297
<li>`OFFSET 0` is the default when there's only one matching element. It means to skip 0 items (so, points to the *1st* match).</li>
297298
<li>`OFFSET 1` skips 1 matches, so points to the *2nd* matches</li>
@@ -308,8 +309,8 @@ module.exports = grammar({
308309
/**
309310
relative_indentation: Helps maintain proper code structure when inserting or replacing code.
310311
Sets the indentation level relative to the context specified in the command:
311-
<li>`INSIDE (FUNCTION|CLASS)`: Reference is the body of the function or class</li>
312-
<li>`(BEFORE|AFTER) (LINE|FUNCTION|CLASS)`: Reference is line, function, or class, regardless of whether BEFORE or AFTER is used</li>
312+
<li>`INSIDE (FUNCTION|METHOD|CLASS)`: Reference is the body of the function, method or class</li>
313+
<li>`(BEFORE|AFTER) (LINE|FUNCTION|METHOD|CLASS)`: Reference is line, function, etc, regardless of whether BEFORE or AFTER is used</li>
313314
When `rel_indent` is 0, code is put at the same level as the reference.
314315
*/
315316
relative_indentation: $ => seq('RELATIVE INDENTATION', field('rel_indent', $.number)),

0 commit comments

Comments
 (0)