PistonDevelopers / VisualRust

Visual Studio extension for Rust
MIT License
702 stars 72 forks source link

Polish: Intellisense is a little too aggressive #290

Open MaulingMonkey opened 7 years ago

MaulingMonkey commented 7 years ago

Edit: some of this was just from bugs: https://github.com/PistonDevelopers/VisualRust/issues/293

This is a good problem to have ;). I'd like to gather some cases where intellisense should perhaps not trigger, or trigger with less information, partially by comparing against e.g. C#'s intellisense. I'm hopeful many of these can be solved with simple lexer checks. My partial list of differences I've discovered so far follows:

Differences

Rust C# Notes
let f var f Intellisense shouldn't try to autocomplete other identifiers when we're trying to define a new identifiers, although perhaps other keywords like mut would still be sane?
pub fn f public static void f Ditto
func( func( Intellisense shouldn't try to "help" us until we start typing a new identifier (signature help, on the other hand, is appropriate)
let a = ( var a = ( Ditto, minus the signature help.
foo. foo. Intellisense shouldn't display keywords when only identifiers will do

Equivalent

Rust C# Notes
let◄◄◄ var◄◄◄ Both seem to continue to display intellisense after typing an identifier occured, to my suprise.

Work list

MaulingMonkey commented 7 years ago

Some work done to fix this in https://github.com/MaulingMonkey/VisualRust/commit/7b9f314a6db4d54a2afff6942cdb3d758fb5a552#diff-d34d4bfb25c66e3dbd8f55cc2c8e38d5R90

I still want to look at other cases where intellisense triggers to compare them to the C# implementation...

MaulingMonkey commented 7 years ago

My changes introduced regressions: . and :: structural tokens generally shouldn't inhibit intellisense, even though ( and < should.