Open auduchinok opened 1 year ago
Can we have a more meaningful example? I'm a bit confused by the example expression here.
Can we have a more meaningful example? I'm a bit confused by the example expression here.
I presume this:
module Module
match () with
| (_ | <here should be an autocomplete, but there's none> )
I didn't know you could put parentheses around some cases. Is there even any point to that?
Also in this example, you already gave a _
which will match anything, so there are no meaningful completions because that branch will never be matched. And even if it was, you're matching ()
so there are no really meaningful completions for that.
I don't know if in the code we are looking at any of that, but still, a better example would be something where some completions would make sense. In this particular case nothing being suggested looks like a feature 😄
I didn't know you could put parentheses around some cases. Is there even any point to that? Also in this example, you already gave a _ which will match anything, so there are no meaningful completions because that branch will never be matched.
In test cases like this it doesn't matter if _
is matched, or if there's _
at all. It's just a minimized version of a particular language construction used in a code completion test. The example could be longer and with more identifiers:
type U =
| A
| B
| C
let f (u: U) =
match u with
| (A | {caret}) -> ()
Here, at the {caret}
position, code completion is expected to work. The minimized example shows exactly this without the noise added by additional definitions.
There's a SynPat.Wild
with non-zero-length range in that exact position for some reason. It is interpreted as a real wildcard, hence no completions. Representation of incomplete constructs could do with an overhaul in the syntax tree.
You get completions as soon as you type another letter, so while this is a regression, it's nothing tragic.
@kerams Thanks for investigation!
Representation of incomplete constructs could do with an overhaul in the syntax tree.
I agree, we should make the pattern errors look similar to the expression ones.
Consider code completion is triggered after
|
in this code:Expected: types, union cases, literals, and active patterns are provided Actual: the items are not provided
This may be related to either changes in the parser or to completion filtering.