-
Notifications
You must be signed in to change notification settings - Fork 342
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
haskell-ident-pos-at-point does not work for operators #1213
Comments
One more thing to observe is qualified operators: |
I'm confused a bit. Here is a code reference. |
Hmm… I think this much involving that seems to be. Actually,
what else? |
|
@gracjan do we have some predicate for operator symbols? If not should we support only ASCII symbols only or all unicode stuff too (there are very large variety of unicode symbols GHC treats as operator symbol)? |
|
@gracjan great, I've tested |
So GHC parses stuff like this:
Note that in the last case So to find real beginning of a qualified identifier we have to go back to a safe character and then move forward (possibly a couple of times). A safe character would be:
Or plainly anything that is not a character valid for qualified identifier or symbol, constructor or not. Some of this logic is already present in |
Fixed by #1224 |
haskell-ident-pos-at-point
returnsnil
when point stands at operator. I believe it should work for them too. We have two cases: infix and normal form. I believe for normal form this function should take into account surrounding parentheses too.One caveat: it's not clear what to do when point is at operator in unfinished expression preceded by opening parenthesis, e.g.
(++
. It may refer to(++ xs)
or(++)
, the former is an infix form and latter is a normal form. I think in this case it's better not to include parenthesis.Related #735
The text was updated successfully, but these errors were encountered: