You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/context.ts
+2-10Lines changed: 2 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@ import type { Comment, Locations, Position, Range, Token } from "./ast";
2
2
importtype{CST,DocumentOptions}from"yaml";
3
3
import{ParseError}from".";
4
4
import{parserOptionsToYAMLOption}from"./options";
5
+
import{sortedLastIndex}from"./utils";
5
6
6
7
exportclassContext{
7
8
publicreadonlycode: string;
@@ -120,16 +121,7 @@ class LinesAndColumns {
120
121
}
121
122
122
123
publicgetLocFromIndex(index: number){
123
-
// The implementation is mostly inspired by ESLint's context.sourceCode.getLocFromIndex
124
-
// See https://github.com/eslint/eslint/blob/f67d5e875324a9d899598b11807a9c7624021432/lib/languages/js/source-code/source-code.js#L657
125
-
126
-
// To figure out which line index is on, determine the last place at which index could
127
-
// be inserted into lineStartIndices to keep the list sorted.
0 commit comments