-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Fix opening file with colon #17281
Fix opening file with colon #17281
Conversation
We require contributors to sign our Contributor License Agreement, and we don't have @fantasticfears on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
Note: 1. POSIX path supports `:` or `.` as filename 2. zed use `PathWithPosition` for parsing CLI path and in-editor navigation. Assumptions and implementation: 1. I assume that `PathWithPosition` doesn't know if filepath exists or not. Users of the class should be mindful. 2. If a filepath has `:`, and position tag is not well-formatted, the implementation will match from right to left to interprete tags. This could make unpredictable behavior. Again, I assume that users of the class should be mindful.
@cla-bot check |
We require contributors to sign our Contributor License Agreement, and we don't have @fantasticfears on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
The cla-bot has been summoned, and re-checked this pull request! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks like a good change to me. it resolves the initial error case and adds a lot of test coverage. even if there is still some undefined behavior with position tag parsing, I think that's preferable to what we have now, so I'm good to merge as-is
Closes zed-industries#14100 Release Notes: - Fixed unable to open file with a colon from Zed CLI ----- I didn't make change to tests for the first two commits. I changed them to easily find offending test cases. Behavior changes are in last commit message. In the last commit, I changed how `PathWithPosition` should intreprete file paths. If my assumptions are off, please advise so that I can make another approach. I also believe further constraints would be better for `PathWithPosition`'s intention. But people can make future improvements to `PathWithPosition`.
Closes #14100
Release Notes:
I didn't make change to tests for the first two commits. I changed them to easily find offending test cases. Behavior changes are in last commit message.
In the last commit, I changed how
PathWithPosition
should intreprete file paths. If my assumptions are off, please advise so that I can make another approach.I also believe further constraints would be better for
PathWithPosition
's intention. But people can make future improvements toPathWithPosition
.