@@ -13,6 +13,7 @@ import React, { useState } from 'react'
1313import { ModelSQLMeshModel } from '@/domain/sqlmesh-model'
1414import { useEventBus } from '@/hooks/eventBus'
1515import type { VSCodeEvent } from '@bus/callbacks'
16+ import { URI } from 'vscode-uri'
1617
1718export function LineagePage ( ) {
1819 const { emit } = useEventBus ( )
@@ -97,10 +98,7 @@ function Lineage() {
9798 )
9899 const selectedModel = selectedModelSet
99100 on ( 'changeFocusedFile' , fileUri => {
100- console . log ( 'on changeFocusedFile' , fileUri )
101- const full_path = fileUri . fileUri . startsWith ( 'file://' )
102- ? fileUri . fileUri . substring ( 7 )
103- : fileUri . fileUri
101+ const full_path = URI . parse ( fileUri . fileUri ) . fsPath
104102 const model = Object . values ( modelsRecord ) . find (
105103 ( m : Model ) => m . full_path === full_path ,
106104 )
@@ -135,7 +133,7 @@ export function LineageComponentFromWeb({
135133 if ( ! model ) {
136134 throw new Error ( 'Model not found' )
137135 }
138- vscode ( 'openFile' , { uri : ' file://' + model . full_path } )
136+ vscode ( 'openFile' , { uri : URI . file ( model . full_path ) . toString ( ) } )
139137 }
140138
141139 function handleError ( error : any ) : void {
0 commit comments