Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vscode/bus/src/callbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export type CallbackShape = Record<string, any>

export type Callback = {
openFile: {
uri: string
filePath: string
}
rpcResponse: RPCResponse
} & CallbackShape
Expand Down
2 changes: 1 addition & 1 deletion vscode/extension/src/commands/tableDiff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export function showTableDiff(
if (workspaceFolders.length != 1) {
throw new Error('Only one workspace folder is supported')
}
const fullPath = vscode.Uri.parse(message.payload.uri)
const fullPath = vscode.Uri.file(message.payload.filePath)
const document = await vscode.workspace.openTextDocument(fullPath)
await vscode.window.showTextDocument(document)
break
Expand Down
4 changes: 2 additions & 2 deletions vscode/extension/src/webviews/lineagePanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class LineagePanel implements WebviewViewProvider, Disposable {
key: 'vscode_send',
payload: {
key: 'changeFocusOnFile',
payload: { path: editor.document.uri.toString() },
payload: { path: editor.document.uri.fsPath },
},
})
}
Expand Down Expand Up @@ -84,7 +84,7 @@ export class LineagePanel implements WebviewViewProvider, Disposable {
if (workspaceFolders.length != 1) {
throw new Error('Only one workspace folder is supported')
}
const fullPath = Uri.parse(message.payload.uri)
const fullPath = Uri.file(message.payload.filePath)
const document = await workspace.openTextDocument(fullPath)
await window.showTextDocument(document)
break
Expand Down
11 changes: 4 additions & 7 deletions vscode/react/src/pages/lineage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import React, { useState } from 'react'
import { ModelSQLMeshModel } from '@/domain/sqlmesh-model'
import { useEventBus } from '@/hooks/eventBus'
import type { VSCodeEvent } from '@bus/callbacks'
import { URI } from 'vscode-uri'
import type { Model } from '@/api/client'
import { useRpc } from '@/utils/rpc'
import {
Expand Down Expand Up @@ -98,13 +97,12 @@ function Lineage() {
return models[0].name
}
// @ts-ignore
const fileUri: string = activeFile.fileUri
const filePath = URI.file(fileUri).path
const filePath: string = activeFile.fileUri
const model = models.find((m: Model) => {
if (!m.full_path) {
return false
}
return URI.file(m.full_path).path === filePath
return m.full_path === filePath
})
if (model) {
return model.name
Expand Down Expand Up @@ -134,9 +132,8 @@ function Lineage() {

React.useEffect(() => {
const handleChangeFocusedFile = (fileUri: { fileUri: string }) => {
const full_path = URI.parse(fileUri.fileUri).path
const model = Object.values(modelsRecord).find(
m => URI.file(m.full_path).path === full_path,
m => m.full_path === fileUri.fileUri,
)
if (model) {
setSelectedModel(model.name)
Expand Down Expand Up @@ -201,7 +198,7 @@ export function LineageComponentFromWeb({
if (!model.full_path) {
return
}
vscode('openFile', { uri: URI.file(model.full_path).toString() })
vscode('openFile', { filePath: model.full_path })
}

function handleError(error: any): void {
Expand Down
Loading