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

[BSP] Use consistent file URI format #2803

Merged
merged 3 commits into from
Oct 2, 2023

Conversation

lolgab
Copy link
Member

@lolgab lolgab commented Sep 30, 2023

Previously we were emitting different URI formats if the sourceFile info was missing or not.
Not sure if this is a problem, but targetId.getUri is returning files as file:///foo/bar/file.scala while our java.io.File toURI returns file:/foo/bar/file.scala
Changing it to .toPath.toUri for consistency

Previously we were emitting different URI formats if the sourceFile info
was missing or not.
Not sure if this is a problem, but targetId.getUri is returning files
as `file:///foo/bar/file.scala` while our `java.io.File` `toURI` returns
`file:/foo/bar/file.scala`
Changing it to `.toPath.toUri` for consistency
@lolgab lolgab marked this pull request as ready for review September 30, 2023 15:46
Copy link
Member

@lefou lefou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, we now always have file:/// for local file URIs?

I know there were other issues (Exceptions) when converting files to URIs, but I can't remember the details right now. Could be some Windows specific thing, but until I recall, we can just ignore that. Using toPath looks ok, but we should definitely leave a comment in the code indicating it's purpose.

@lefou lefou merged commit 7c2114e into com-lihaoyi:main Oct 2, 2023
35 checks passed
@lefou lefou added this to the 0.11.5 milestone Oct 2, 2023
@lolgab lolgab deleted the consistent-uris-bsp branch October 2, 2023 08:22
@lolgab
Copy link
Member Author

lolgab commented Oct 2, 2023

Thank you for making the changes for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants