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

Fix Crystal tool cursor parsing for filenames containing : #13129

Merged

Conversation

HertzDevil
Copy link
Contributor

Fixes #13086.

file_and_line, _, col = cursor.rpartition(':')
file, _, line = file_and_line.rpartition(':')

raise ArgumentError.new "cursor location must be file:line:column" if file.empty? || line.empty? || col.empty?
Copy link
Contributor

Choose a reason for hiding this comment

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

This line is pretty long already, so I'd suggest:

Suggested change
raise ArgumentError.new "cursor location must be file:line:column" if file.empty? || line.empty? || col.empty?
if file.empty? || line.empty? || col.empty?
raise ArgumentError.new "cursor location must be file:line:column"
end

@straight-shoota straight-shoota merged commit 856fbe0 into crystal-lang:master Mar 4, 2023
@HertzDevil HertzDevil deleted the bug/crystal-cursor-with-colon branch March 4, 2023 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot use absolute path for tools cursor on Windows
4 participants