helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
33.94k stars 2.51k forks source link

unable to conver uri to filepath #11334

Open 1925381584 opened 3 months ago

1925381584 commented 3 months ago
OuxS9il0xv

hello, when I goto definition on a varible, This prompt came up. how can i solve it?

win10 C# hx: 24.7

pascalkuthe commented 3 months ago

This is a relative windows path ..\..\..\..\CanJuSheJi.xaml. URLs are always supposed to be absolute paths and that is all the rust url crate (and helix) support https://github.com/servo/rust-url/issues/487#issuecomment-466788623.

The vsoced-uri node package used by vsocde does allow relative paths (it doesn't really try to decode them at all). I don't think we really need to URL crate at all as we are only extracting paths so likely just forking lsp-types, replacing URLs with strings and using something like percent encoding directly (plus some logic to extract out the path) should be easy enough.

1925381584 commented 3 months ago

thanks for your replay, But I still don't understand how to fix it. Or is this not a problem with Helix?

pascalkuthe commented 3 months ago

you can't fix this on your end. It needs to be fixed in the language server or helix

1925381584 commented 3 months ago

Oh, I get it.

rbwork2024 commented 4 weeks ago

Is that also a standard language server convention requirement or just a requirement for rust-url?

EDIT: I see, URL is absolute as opposed to URI which can be relative. Should language servers always provide a URL? Or is this simply a Helix limitation due to the crate being used to resolve these links?

the-mikedavis commented 3 weeks ago

This is just a limitation of using the url I believe. #11889 is working towards dropping that crate and performing the percent encoding/decoding directly