Skip to content

Commit

Permalink
Fix hover on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronvg committed Jan 10, 2025
1 parent 24fc5eb commit 7ec3759
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 7ec3759

Please sign in to comment.