Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Git Bash Vim ALE #18659

Open
coffeebe4code opened this issue Dec 10, 2024 · 7 comments
Open

Windows Git Bash Vim ALE #18659

coffeebe4code opened this issue Dec 10, 2024 · 7 comments
Labels
A-lsp LSP conformance issues and missing features C-bug Category: bug

Comments

@coffeebe4code
Copy link

coffeebe4code commented Dec 10, 2024

On windows I am in a git bash shell, within vim, using ALE.

I am receiving this error "url is not a file"

** edit ** sorry githubs make an issue from this line did not actually make an issue from that line.

let path = url.to_file_path().map_err(|()| anyhow::format_err!("url is not a file"))?;

@lnicola
Copy link
Member

lnicola commented Dec 11, 2024

Can you patch that to display url? But anyway, we should upgrade lsp-types, and Url has been replaced by Uri in the latest version.

CC gluon-lang/lsp-types#284, yeah, maybe we're not going to upgrade right now.

@lnicola lnicola added C-bug Category: bug A-lsp LSP conformance issues and missing features labels Dec 11, 2024
@coffeebe4code
Copy link
Author

coffeebe4code commented Dec 11, 2024

If I'm understanding that link. I should be able to downgrade the rust-analyzer version? Which version should I go to?

Can you patch that to display url?

This will take me some time. I'll see if I can do that sometime today.

My suspicion would be some sort of hybrid mingw path is not getting parsed correctly?

@lnicola
Copy link
Member

lnicola commented Dec 11, 2024

If I'm understanding that link. I should be able to downgrade the rust-analyzer version?

No, I don't think this is a recent issue. The link is more about how we probably can't upgrade lsp-types right now because the new version is missing some functionality.

@coffeebe4code
Copy link
Author

url: 'file:///c/Users/ChrisClark/type-lang/linker/src/lib.rs' is not a file

@lnicola
Copy link
Member

lnicola commented Dec 11, 2024

Well, that's funny... At least on Linux, with url = "=2.5.2" (the version we're using):

dbg!(
    Url::parse("file:///c/Users/ChrisClark/type-lang/linker/src/lib.rs")
        .unwrap()
        .to_file_path()
);

[src/main.rs:19:5] Url::parse("file:///c/Users/ChrisClark/type-lang/linker/src/lib.rs").unwrap().to_file_path() = Ok(
    "/c/Users/ChrisClark/type-lang/linker/src/lib.rs",
)

@lnicola
Copy link
Member

lnicola commented Dec 11, 2024

Url is a re-export in lsp-types 0.95.0: https://docs.rs/lsp-types/0.95.0/src/lsp_types/lib.rs.html#26.

@coffeebe4code
Copy link
Author

coffeebe4code commented Dec 12, 2024

I didn't want to spend too much time going through the URL crate. But it annoyed me very quickly.

As a file path, my path is obviously legitimate. I found a few pieces of code that had cfg! checks for windows. Which is silly to say the least. I see this a lot across lots of projects. People aren't making their libraries api's cross-platform. I may be on a linux machine, and want to validate if a windows file path is valid, and this case visa-versa.

I'm very interested in developing on Windows, and would be happy to make a change to support it. What is the shortest path that would be acceptable by the rust-analyzer team for me to do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lsp LSP conformance issues and missing features C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants