if (declarationKind == DeclarationKind.Struct) return GetDeclaration("struct");
if (declarationKind == DeclarationKind.Class) return GetDeclaration("class");
On the first line Intellicode suggested DeclarationKind.Struct. That was a good suggestion. On the second line it suggested DeclarationKind.Struct again. That's a bad suggestion because not only is it unlikely to be what I want to do, it would be unreachable code.
I'd like to see it definitely not do it when it's unreachable. However, even if my if statement didn't return and the second case was reachable, I'd like Intellicode to guess that I'm unlikely to be repeating the same condition. DeclarationKind.Struct could still be starred, but shouldn't be the top priority suggestion.
If it could have seen that my "struct" string was a lowercase version of the name "Struct" and then suggested "class" because it's the lowercase version of "Class", that would be magic.
I build developer tools and services at Microsoft (currently Codespaces, Live Share, IntelliCode) and maintain some OSS projects (CodeTour, GistPad, CodeSwing, WikiLens)
That’s great feedback! We currently take a lot of context into account when providing suggestions, but there’s still plenty of room to improve 👍 These are both good examples for us to use to iterate. Keep the feedback coming!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I just wrote the following code
On the first line Intellicode suggested
DeclarationKind.Struct
. That was a good suggestion. On the second line it suggestedDeclarationKind.Struct
again. That's a bad suggestion because not only is it unlikely to be what I want to do, it would be unreachable code.I'd like to see it definitely not do it when it's unreachable. However, even if my
if
statement didn't return and the second case was reachable, I'd like Intellicode to guess that I'm unlikely to be repeating the same condition.DeclarationKind.Struct
could still be starred, but shouldn't be the top priority suggestion.If it could have seen that my "struct" string was a lowercase version of the name "Struct" and then suggested "class" because it's the lowercase version of "Class", that would be magic.
That’s great feedback! We currently take a lot of context into account when providing suggestions, but there’s still plenty of room to improve 👍 These are both good examples for us to use to iterate. Keep the feedback coming!