For example, it doesn't eat ', which are valid in identifiers.
We probably need to use the identifier regex in a forward search, rather than my quick-fix "sublime expand to word" solution :)
But how to go backwards?
Searching backwards uses the existing code from completion. If it needs to be more permissive, maybe the query function does need to be split for completion vs type inspection.
See, goa'uld is a valid identifier. If you position the cursor between l and d, it should work.
goa'uld is also broken for autocompletion (type goa'ul <ctrl+space>). It shows the generic local let binding, not the full completion. We need to adjust the regex to include ' :)
In fact, do we need to include the generic local let bindings at all? The switch to -F and --context should pick those up now...
Would it pick up bar in let foo _ = let bar = 1 in <cursor> ? If yes, feel free to drop it.
let foo _ = let bar = 1 in <cursor>
Looks like no. You can test that yourself - the autocomplete shows type "let" for the locally detected variables, and a proper type for the ocp-index ones. I guess context is only really useful for opens :)
I was just checking -- perhaps you know ocp-index better than I do. :) Then let sniffing probably stays. I really don't like it, it's silly and flawed and doesn't respect lexical scope and doesn't pick up bindings in patterns, but it's still quite useful.
I've considered using sublime's "scopes" feature to pull out bindings from patterns, but the highlighting file is completely incomprehensible and it doesn't have a specific scope for one variable inside pattern. Rather, it highlights everything that is not a variable inside a pattern in a differing way. :/
Add # and ' to regex for non-module reference searches and type inspe…
…ction expander. Fixes #6.
I think we're hitting the limits of what can be done without running merlin in the background as vim/emacs do :)
Pretty easy fix in the end, I didn't quite understand what the regex was doing before.
awesome. There are some plans for merlin, but they're blocked on upstream (cc @def-lkb)