From 7ec3759d0a27259986b50e98c2106f2b9367e4ba Mon Sep 17 00:00:00 2001 From: aaronvg Date: Fri, 10 Jan 2025 14:06:17 -0800 Subject: [PATCH] Fix hover on windows --- .../language-server/src/lib/baml_project_manager.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/typescript/vscode-ext/packages/language-server/src/lib/baml_project_manager.ts b/typescript/vscode-ext/packages/language-server/src/lib/baml_project_manager.ts index fa1e093a1..5a6502217 100644 --- a/typescript/vscode-ext/packages/language-server/src/lib/baml_project_manager.ts +++ b/typescript/vscode-ext/packages/language-server/src/lib/baml_project_manager.ts @@ -212,11 +212,11 @@ class Project { this.current_runtime = undefined } - get_file(file_path: string) { + get_file(file_path: URI) { // Read the file content - const fileContent = readFileSync(file_path, 'utf8') + const fileContent = readFileSync(file_path.fsPath, 'utf8') - const doc = TextDocument.create(file_path, 'plaintext', 1, fileContent) + const doc = TextDocument.create(file_path.fsPath, 'plaintext', 1, fileContent) return doc } @@ -281,7 +281,8 @@ class Project { end: { line: match.end_line, character: match.end_character }, } - const hoverDoc = this.get_file(URI.file(match.uri).toString()) + + const hoverDoc = this.get_file(URI.file(match.uri)) if (hoverDoc) { const hoverText = hoverDoc.getText(range)