-
-
Notifications
You must be signed in to change notification settings - Fork 649
Clean symbol before doing look up #887
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
Conversation
I think it will be better to do the cleanup in |
65cf5a0
to
1afde95
Compare
@bbatsov agreed, that is a much better location for this logic. Updated the pull request to stick the new |
Also, I'm using |
I think you can simply use a regexp to remove anything that's not a letter at the beginning of the symbol name. |
P.S. You should also add a changelog entry and a couple of unit tests. |
I'll add some tests and update the change log in a bit (and make sure all existing tests pass...which they don't). Do we really want to strip anything that's not a letter from the beginning? That would cause a valid symbol like |
You're totally right; I should have thought a bit more about the problem. Your proposal is sound. Another alternative would be to strip just things we know we should strip ( |
I prefer the stripping things we know we should strip specifically, rather than attempting to strip anything that doesn't look valid. It's an easier to problem to get right without odd bugs creeping up. |
If you attempt to run `cider-jump-to-var` to find the definition of an atom dereferenced with `@`, cider can't find the source location. If you remove the `@` cider has no issues finding the location. This allows for cleaning non-variable components out of a symbol before doing the look up to prevent this issue.
1afde95
to
8ab9ae1
Compare
I've fixed the failing test (by accounting for empty string causing substring to throw errors) and added a new one to specifically test for I can include |
This leads me to be believe that |
If you attempt to run
cider-jump-to-var
to find the definition of anatom dereferenced with
@
, cider can't find the source location. If you removethe
@
cider has no issues finding the location. This allows for cleaningnon-variable components out of a symbol before doing the look up to prevent this
issue.
Possible fix for #886