Skip to content

Commit 3b2f652

Browse files
feat(debugger): fix file URI handling for Windows in inspect event (#514)
Ensure that file URIs starting with an extra slash on Windows are correctly normalized.
1 parent e45f4ea commit 3b2f652

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lua/flutter-tools/runners/debugger_runner.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ local function handle_inspect_event(isolate_id)
146146

147147
if location and location.file and location.line then
148148
local file = location.file:gsub("^file://", "")
149+
if vim.loop.os_uname().sysname == "Windows_NT" then
150+
-- On Windows, the file URI may start with an extra slash
151+
file = file:gsub("^/", "")
152+
end
149153
vim.schedule(function()
150154
vim.cmd("edit " .. vim.fn.fnameescape(file))
151155
vim.api.nvim_win_set_cursor(0, { location.line, (location.column or 1) - 1 })

0 commit comments

Comments
 (0)