You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// The name of the workspace folder. Defaults to the uri's basename.
pubname:String,
}
Given the JSON of that request, this will be deserialize to a url::Url. The problem though is the trailing slash is significant to the Url crate, so the representation in Url is now incorrect because it now considers this a file url rather than a directory. For example, doing .join will not work properly (https://docs.rs/url/2.3.1/url/struct.Url.html#method.join -- "Note: a trailing slash is significant."). A consumer of this crate must then take the url out as a string and normalize it to have a trailing slash (then I believe the consumer must also maintain a mapping back to the original unnormalized value when using this in any responses).
Perhaps it would be better if these values were not deserialized to the url crate's Url representation?
The text was updated successfully, but these errors were encountered:
Consider a workspace folder sent from a client that sends a folder url like
"uri": "file:///dev/my-project"
(such as what VSCode does).lsp-types/src/workspace_folders.rs
Lines 26 to 31 in 962604a
Given the JSON of that request, this will be deserialize to a
url::Url
. The problem though is the trailing slash is significant to theUrl
crate, so the representation inUrl
is now incorrect because it now considers this a file url rather than a directory. For example, doing.join
will not work properly (https://docs.rs/url/2.3.1/url/struct.Url.html#method.join -- "Note: a trailing slash is significant."). A consumer of this crate must then take the url out as a string and normalize it to have a trailing slash (then I believe the consumer must also maintain a mapping back to the original unnormalized value when using this in any responses).Perhaps it would be better if these values were not deserialized to the url crate's
Url
representation?The text was updated successfully, but these errors were encountered: