-
Notifications
You must be signed in to change notification settings - Fork 18
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
Error rebugging function when cursor is not positioned over the first character. #4
Comments
I think this is a good idea. However, I worry a bit about distinguishing things like this (imagine your cursor is positioned on the julia> x = 1.2
1.2
julia> 2float(x) # means the same thing as 2*float(x)
2.4
julia> int2float(x) # references a method
ERROR: UndefVarError: int2float not defined
Stacktrace:
[1] top-level scope at none:0 So while you're backing up do you include the Worst-case scenario I can throw a nicer error. Not quite sure what's best here. |
Hmm, I see. I'm not familiar with the internals of Rebugger, but I thought that it'd work with Expr objects of the actual code? Your comments seems to suggest that rather, it does string-parsing. If that's the case, I think parsing the actual expression would be a more robust approach that'd allow Rebugger too see in the case of |
It would be nice if rebugger did something sensible rather than throw this error. |
The best way to solve this would be to parse the complete input line. But because parsing doesn't provide any mechanism to then match expressions/symbols/whatever to the position in the input string, it's not entirely obvious how you go about aligning the two. |
CSTParser.jl should provide that information, but it's docs are sparse (and it is a big dep). Or as a quick hack use a regex to go backward til you hit a non-letter |
To rebug this, the cursor currently must be positioned on the
a
.If it's on e.g. the b, an error is thrown:
It'd be great if rebugger worked with the cursor positined at any character of the function name.
The text was updated successfully, but these errors were encountered: