Skip to content

Commit

Permalink
[ change ] Only treat URLs with the "lsp:" protocol as URLs, otherwis…
Browse files Browse the repository at this point in the history
…e as filepaths
  • Loading branch information
banacorn committed Feb 19, 2025
1 parent 8e186e5 commit 03859f0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/js/src/Connection/Connection__URI.bs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions src/Connection/Connection__URI.res
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ let parse = async path => {
let result = try Some(NodeJs.Url.make(path)) catch {
| _ => None
}
// single out the URL with the protocol "lsp:"
let result = switch result {
| Some(url) =>
if url.protocol == "lsp:" {
Some(url)
} else {
None
}
| None => None
}
// only treat URLs with the protocol "lsp:" as URLs
switch result {
| Some(url) => URL(url)
| None =>
Expand Down

0 comments on commit 03859f0

Please sign in to comment.