Url and path refactor #9

Merged
zenmaya merged 8 commits from url-handling into main 2025-05-22 14:51:14 +02:00
Owner
No description provided.
zenmaya changed title from WIP: Url and path refactor to Url and path refactor 2025-05-22 14:18:47 +02:00
@ -114,3 +95,1 @@
},
}
}
let target = Url::parse(target).unwrap_or_else(|_| {
Collaborator

is it on purpose that invalid URLs now yield file:/// instead of being skipped?

is it on purpose that invalid URLs now yield `file:///` instead of being skipped?
Author
Owner

good point, I need to just skip them, I somehow didn't notice this obvious solution to non indexable urls

good point, I need to just skip them, I somehow didn't notice this obvious solution to non indexable urls
@ -0,0 +6,4 @@
use tracing::{error, info, warn};
use crate::Url;
Collaborator

where did this come from? isn't it url::Url? i don't see any definition of Url in the crate root

where did this come from? isn't it `url::Url`? i don't see any definition of `Url` in the crate root
Author
Owner

I don't know honestly, this also should be url::Url

I don't know honestly, this also should be `url::Url`
@ -0,0 +71,4 @@
fn extension(&self) -> Option<OsString>;
fn last_segment_starts_with(&self, prefix: &str) -> bool;
fn is_dir(&self) -> bool;
fn to_dir(&mut self);
Collaborator

hmm, this is going to be a bunch more work, but i think it'd be better to make a newtype wrapper for a Url that is a directory that gets returned by this method, instead of mutating in place? it feels like it's too easy to forget to do it. but can be totally left for later

hmm, this is going to be a bunch more work, but i think it'd be better to make a newtype wrapper for a Url that is a directory that gets returned by this method, instead of mutating in place? it feels like it's too easy to forget to do it. but can be totally left for later
Author
Owner

I was mostly thinking about how much pain is going to be calling toString and then parse on the url, so I opted into mutation, but definitely can be changed later) I'll make a todo

I was mostly thinking about how much pain is going to be calling toString and then parse on the url, so I opted into mutation, but definitely can be changed later) I'll make a todo
Collaborator

i'm a bit surprised by the reqwest and http resources, is this really how LSP expects servers to access files? it feels super wrong, not on your part, on theirs.

other than the nitpicks/questions above looks good^^

i'm a bit surprised by the reqwest and http resources, is this really how LSP expects servers to access files? it feels super wrong, not on your part, on theirs. other than the nitpicks/questions above looks good^^
zenmaya deleted branch url-handling 2025-05-22 14:51:14 +02:00
Author
Owner

@max wrote in #9 (comment):

.

Well, the lsp server is supposed to support even remote files (like sftp, sshfs etc, so these should be supported i think. That's why I implemented the directory listing pretty protocol agnosticly)

@max wrote in https://git.zenmaya.xyz/zenmaya/prowl/pulls/9#issuecomment-70: > . Well, the lsp server is supposed to support even remote files (like sftp, sshfs etc, so these should be supported i think. That's why I implemented the directory listing pretty protocol agnosticly)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zenmaya/prowl!9
No description provided.