@@ -13,7 +13,6 @@ 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'
1716import type { Model } from '@/api/client'
1817import { useRpc } from '@/utils/rpc'
1918import {
@@ -98,13 +97,12 @@ function Lineage() {
9897 return models [ 0 ] . name
9998 }
10099 // @ts -ignore
101- const fileUri : string = activeFile . fileUri
102- const filePath = URI . file ( fileUri ) . path
100+ const filePath : string = activeFile . fileUri
103101 const model = models . find ( ( m : Model ) => {
104102 if ( ! m . full_path ) {
105103 return false
106104 }
107- return URI . file ( m . full_path ) . path === filePath
105+ return m . full_path === filePath
108106 } )
109107 if ( model ) {
110108 return model . name
@@ -134,9 +132,8 @@ function Lineage() {
134132
135133 React . useEffect ( ( ) => {
136134 const handleChangeFocusedFile = ( fileUri : { fileUri : string } ) => {
137- const full_path = URI . parse ( fileUri . fileUri ) . path
138135 const model = Object . values ( modelsRecord ) . find (
139- m => URI . file ( m . full_path ) . path === full_path ,
136+ m => m . full_path === fileUri . fileUri ,
140137 )
141138 if ( model ) {
142139 setSelectedModel ( model . name )
@@ -201,7 +198,7 @@ export function LineageComponentFromWeb({
201198 if ( ! model . full_path ) {
202199 return
203200 }
204- vscode ( 'openFile' , { uri : URI . file ( model . full_path ) . toString ( ) } )
201+ vscode ( 'openFile' , { filePath : model . full_path } )
205202 }
206203
207204 function handleError ( error : any ) : void {
0 commit comments