Skip to content

Commit 6bff7b4

Browse files
authored
fix: documentation for TokenIterator methods (#4955)
1 parent fc56af5 commit 6bff7b4

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

src/edit_session.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,7 @@ EditSession.$uid = 0;
309309
/**
310310
* Starts tokenizing at the row indicated. Returns a list of objects of the tokenized rows.
311311
* @param {Number} row The row to start at
312-
*
313-
*
314-
*
312+
* @returns {Token[]}
315313
**/
316314
this.getTokens = function(row) {
317315
return this.bgTokenizer.getTokens(row);
@@ -321,7 +319,7 @@ EditSession.$uid = 0;
321319
* Returns an object indicating the token at the current row. The object has two properties: `index` and `start`.
322320
* @param {Number} row The row number to retrieve from
323321
* @param {Number} column The column number to retrieve from
324-
*
322+
* @returns {Token}
325323
*
326324
**/
327325
this.getTokenAt = function(row, column) {

src/token_iterator.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ var TokenIterator = function(session, initialRow, initialColumn) {
2929
(function() {
3030

3131
/**
32-
* Tokenizes all the items from the current point to the row prior in the document.
33-
* @returns {[String]} If the current point is not at the top of the file, this function returns `null`. Otherwise, it returns an array of the tokenized strings.
32+
* Moves iterator position to the start of previous token.
33+
* @returns {Token|null}
3434
**/
3535
this.stepBackward = function() {
3636
this.$tokenIndex -= 1;
@@ -48,10 +48,10 @@ var TokenIterator = function(session, initialRow, initialColumn) {
4848

4949
return this.$rowTokens[this.$tokenIndex];
5050
};
51-
51+
5252
/**
53-
* Tokenizes all the items from the current point until the next row in the document. If the current point is at the end of the file, this function returns `null`. Otherwise, it returns the tokenized string.
54-
* @returns {String}
53+
* Moves iterator position to the start of next token.
54+
* @returns {Token|null}
5555
**/
5656
this.stepForward = function() {
5757
this.$tokenIndex += 1;
@@ -74,8 +74,8 @@ var TokenIterator = function(session, initialRow, initialColumn) {
7474

7575
/**
7676
*
77-
* Returns the current tokenized string.
78-
* @returns {String}
77+
* Returns current token.
78+
* @returns {Token}
7979
**/
8080
this.getCurrentToken = function () {
8181
return this.$rowTokens[this.$tokenIndex];

0 commit comments

Comments
 (0)