Skip to content

Commit

Permalink
Add example to positionAt (#1051)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilja authored Aug 23, 2022
1 parent e3b566d commit 3f563b1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions textDocument/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ export interface TextDocument {
*
* @param offset A zero-based offset.
* @return A valid [position](#Position).
* @example The text document "ab\ncd" produces:
* * position { line: 0, character: 0 } for `offset` 0.
* * position { line: 0, character: 1 } for `offset` 1.
* * position { line: 0, character: 2 } for `offset` 2.
* * position { line: 1, character: 0 } for `offset` 3.
* * position { line: 1, character: 1 } for `offset` 4.
*/
positionAt(offset: number): Position;

Expand Down

0 comments on commit 3f563b1

Please sign in to comment.