@@ -16,8 +16,9 @@ import { findNext, findPrev } from "./source-search";
1616import { isWasm , lineToWasmOffset , wasmOffsetToLine } from "../wasm" ;
1717import { isOriginalId } from "devtools-source-map" ;
1818
19- import type { AstPosition , AstLocation } from "../../workers/parser/types " ;
19+ import type { AstLocation } from "../../workers/parser" ;
2020import type { EditorPosition , EditorRange } from "../editor/types" ;
21+ import type { Location } from "../../types" ;
2122
2223export function shouldShowPrettyPrint ( selectedSource ) {
2324 if ( ! selectedSource ) {
@@ -60,7 +61,7 @@ export function toEditorLine(sourceId: string, lineOrOffset: number): number {
6061 return lineOrOffset ? lineOrOffset - 1 : 1 ;
6162}
6263
63- export function toEditorPosition ( location : AstPosition ) : EditorPosition {
64+ export function toEditorPosition ( location : Location ) : EditorPosition {
6465 return {
6566 line : toEditorLine ( location . sourceId , location . line ) ,
6667 column : isWasm ( location . sourceId ) || ! location . column ? 0 : location . column
@@ -121,16 +122,6 @@ function isVisible(codeMirror: any, top: number, left: number) {
121122 return inXView && inYView ;
122123}
123124
124- export function toSourceLocation (
125- sourceId : string ,
126- location : EditorPosition
127- ) : AstPosition {
128- return {
129- line : toSourceLine ( sourceId , location . line ) ,
130- column : isWasm ( sourceId ) ? undefined : location . column
131- } ;
132- }
133-
134125export function markText ( editor : any , className , { start, end } : EditorRange ) {
135126 return editor . codeMirror . markText (
136127 { ch : start . column , line : start . line } ,
0 commit comments