Code Completion Fire and Mercury Suggestion

I have a suggestion for the code editor in Fire when editing Mercury. I’m not sure that code completion when declaring a variable makes sense when typing the “As” segment of the declaration. Because it is only two letters, I’m unlikely to use code completion, and it actually seems to cause problems if I type “as” instead of “As” - it picks something completely different than what I want. (In the example below, I didn’t press Enter to select the suggestion - this is what happens when type “as” and then a space.) Because VB is case-insensitive, I usually don’t capitalize the “as” while I’m typing, so this was kind of shocking at first.

Here’s a short video that shows what I mean:

My recommendation is to eliminate code completion for Mercury for that segment of variable declaration (as Visual Studio seems to do), or make it case-insensitive so that it correctly picks up what most people would want in this case (“as”) and not something else. Obviously there should still be code completion after that part of the variable type.

Thanks,

–Avonelle

1 Like

I think the real problem her tis that CC shows stuff that actually *isn’t’ valid (possibly paired with the fact that as<space> should probably always pick "as and no trigger variant.

That said, I cannot repro the second part; ig I just ignore CC and type through “A S SPACE”, I get As, not something else/wrong…

Thanks, logged as bugs://85437

Yeah, good point! Showing invalid things certainly not helpful! Solving that problem I’m sure will make it better. Thanks!

–Avonelle

1 Like

THAT said, while CC is driven by the compiler itself, it doesn’t all come “free” and many places need to be fine-tuned especially for CC — and I’m sure there’s still many areas that aren’t perfect, so please do let me know about any you find.

The rules are as follows:

  • CC should only ever show tokens that will be valid tab the current position. if only an unknown token is valid (e.g. after Dim), you should see "nothing to complete)
  • All valid (known) items should e in CC, so there’s never a case where something valid (and known) is missing
  • if unknown tokens are valid next to known ones, CC selection will be “soft” and should only accept for enter, not space). I cant think of a good example in VB, but eg in C#, .Where(| would accept a new lambda var:

so typing thru a new var doesn’t accept an existing value. thats indicated by the rectangle selection rather than the solid one:

(“my” is still a potential full match; “myn(ewlambda)” no longer is, so the selection turns soft).

Any place you find where one of these three conditions isn’t met, thats a CC bug :wink:

1 Like

Thanks for spelling out the rules so clearly. I definitely will let you know if I notice anything else amiss!

–Avonelle

2 Likes

Thanx, much appreciated!

bugs://85437 got closed with status fixed.

1 Like

bugs://85437 got closed with status fixed.