DEV Community

Discussion on: Have you tried IntelliCode? If so, what's your favorite (or least favorite!) suggestions so far?

Collapse
 
sampruden profile image
Sam • Edited

I have another scenario where I would have liked to have a suggestion.

class Foo
{
    public int Bar { get; private set; }

    public Foo(int bar)
    {
        this.Bar = ...
    }
}

I would like Intellicode to suggest bar here. On account of the matching name, type, common constructor patterns, and it being the only variable in scope, it should be confidently guessable. Currently I get no Intellicode suggestions in this position.

With plain Intellisense, autocompleting in this position often leads to frustration. Hurrying through this process and using autocompletion I often accidentally end up with this.Bar = this.Bar by accident. That might be user error on my part, but it happens when I'm going fast. Having the sensible one suggested by Intellicode here could reduce my error rate significantly.

Collapse
 
lostintangent profile image
Jonathan Carter

Interesting! When you're typing this line fast, do you actually type this. after the =, or is auto-completion suggesting that and making it easier to accidentally select it?

Collapse
 
sampruden profile image
Sam • Edited

Plain Intellisense is giving me Bar as an option, but I have my code style preferences set to prefer this.Bar so it's getting automatically applied. I'm not typing the this.. Actually I just tried it again now and it's not happening, but it definitely does sometimes. That's something in my VS setup unrelated to Intellicode.

The this. formatting isn't an issue. What matters is that I get Bar when I want bar. There's no bug there, it's just my own clumsiness navigating through the completion list, and sometimes typing fast and capitalising when I don't mean to. I'm badly coordinated, I mess up my typing quite a lot.

bar and Bar look very similar, and are very similar to type. I like my constructor parameters to have camelcase versions of property names. It's a common pattern but typo prone.

If Intellicode always just immediately surfaced the correct one at the top of the list I wouldn't have the opportunity to make the typo, and that would be a quality of life improvement for me.

I don't know, but I guess that this could be quite a big issue for some dyslexic users.