Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 VA2385: completion list trouble
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Aug 20 2020 :  07:16:11 AM  Show Profile  Reply with Quote
Here is a recording of something that bugs me a lot and happens quite frequently. In this case I am inside a method in the "RangeLimit" class and change a parameter of the method.
Pay attention how the suggestion list from VA gets replaced by a useless one from VS I think, in the first 2 seconds.



As I am currently adding lots of classes derived from a common class, I made a template class which I copy and replace names. One of the moment where I get crazy everytime is the copy ctor of the class.

its like this:
		public template(template other)
		{
			// copy members
			this._someMember = ;
		}

Every friggin time i type "ot" and hit enter, "object" is inserted instead of "other", its the very same effect as seen in the above.

feline
Whole Tomato Software

United Kingdom
16947 Posts

Posted - Aug 21 2020 :  10:59:51 AM  Show Profile  Reply with Quote
The listbox being replaced is happening to me as well, in VA 2382. Now to see if this is a recent change in VA, or perhaps due to a recent update to VS2019.

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16947 Posts

Posted - Aug 24 2020 :  1:18:19 PM  Show Profile  Reply with Quote
Well, that didn't go quite as expected. The listbox being replaced with a bigger listbox is actually only happening when you have:

VA Options -> Suggestions -> Show only suggestions in completion lists = OFF

turn this setting On and the listbox is no longer being replaced. So nothing to do with the specific IDE version.

case=142812

For the second part though, so far I cannot reproduce the problem.

Testing VS2019, VA 2385.6, the closest I have been able to get is when the VA suggestions setting is set to Off, and I type the single letter 'o' in your code sample. As the suggestion, 2 line, listbox appears for me the default item is "other", but a moment later the suggestion listbox is replaced by a full listbox, and the current item changes to "object".

But, when testing with the VA option set to On, when I type 'o' the two line suggestion listbox appears with "other" as the default item, and then a moment later the default item changes to "object". It seems the item changing and the listbox being replaced are happening at the same time, but are somewhat independent events.

So far though, in all of my tests, if I type "ot" here I am always left with "other" as the selected item in the listbox. I am testing with:

VA Options -> Enhanced Listboxes -> Shrink as you type = ON
VA Options -> Enhanced Listboxes -> Allow Acronyms and Shorthand = ON
VA Options -> Enhanced Listboxes -> Prefer Acronym matches = ON

but I am not sure if any of these are matter.

How does this compare to what you are seeing?

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Aug 25 2020 :  07:01:50 AM  Show Profile  Reply with Quote
Same settings here, yet I get always the object (and other useless substitutions) after the second letter. Sometimes, when I repeat the process a few times at the same location (type ot, backspace, type ot, backspace, etc) then it stabilizes and it remains fixed showing me "other" instead of "object", same with other symbols.
This problem is expecially bugging when using lambda expressions, like this:

			modelBuilder.Entity<Project>(entity =>
			{
				entity.HasKey(k => k.ID);
				entity.Property(s => s.ID).HasColumnName("id").ValueGeneratedOnAdd();
				entity.Property(s => s.Name).IsRequired().HasMaxLength(50).IsUnicode(true);
				entity.Property(s => s.Description).HasMaxLength(200).IsUnicode(true);
			});


Any of the k or s, are subject to being replaced, when pressing space, by whatever VS or VA (not sure who) thinks I might want to write. In those situations I have to cancel the listbox or I cant write single letter the var name.
Somehow this whole problem seems to be related to a delay in finding the correct type and name.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16947 Posts

Posted - Aug 26 2020 :  10:22:46 AM  Show Profile  Reply with Quote
Are you seeing the replace problem on the first instance of 'k' and 's', so before the => or after the => or both?

If the problem is happening before => then we don't have any way of knowing that you are about to type a Lambda expression, so if you have VA suggestions active, it is "reasonable" for the suggestion listbox to have focus, since assuming you are about to use an existing, known symbol here is reasonable. After the => we should be able to work out that we are working in a Lambda, and that 'k' and 's' are local variables in scope.

I am starting to think that the only solid solution here is a setting to tell VA to never give suggestion listboxes full focus by default.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Aug 26 2020 :  10:55:52 AM  Show Profile  Reply with Quote
First use, before the =>
In this case the assumption that I will use an existing symbol is void, since after the bracket after "Property" I will necessarily introduce a new temporary variable, k or s, or whatever comes to mind, which will be used in the lambda expression.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16947 Posts

Posted - Aug 26 2020 :  12:54:56 PM  Show Profile  Reply with Quote
How can we tell this?

It took a while to make any real sense of what you were doing here. I think, based on some hunting around in the solution you sent me, that you are creating default instances of classes here, which is why it looks like you are checking 3 different conditions in a row. Instead of checking, you are setting defaults, I think.

I am not sure what type "entity" is in this case, so I don't know what Property function is being called, and thus, don't know anything about its signature.

Based on similar looking code found in the file "Q6Context.cs" in your solution, VA is having the same problem. Although asking VS2019 is getting me to:

public class EntityTypeBuilder<TEntity> : EntityTypeBuilder where TEntity : class
{
    public virtual PropertyBuilder<TProperty> Property<TProperty>([NotNullAttribute] Expression<Func<TEntity, TProperty>> propertyExpression);
}

Now I need to go read up on "Expression<Func...>"

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Aug 26 2020 :  1:01:54 PM  Show Profile  Reply with Quote
Yeah, that stuff is a bit tedius. You may find more information on that specific configuration here (not my code): https://www.entityframeworktutorial.net/efcore/configure-one-to-many-relationship-using-fluent-api-in-ef-core.aspx
Go to Top of Page

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Aug 27 2020 :  04:58:37 AM  Show Profile  Reply with Quote
There is another place where this is happening, noticed that today again. I was documenting a lot of methods and classes, and for some reason, occasionally VA insists to complete my words in comments with symbol names. Just like it does sometimes in non-code files.
So typing along in a C# comment line

///<summary>Now there is some m</summary>


And then m triggers insertion of whatever might match "m", and, if I try to repeat that, by backspacing and typing again, it happens 2, 3 times, then ceases.
Go to Top of Page

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Aug 27 2020 :  05:06:02 AM  Show Profile  Reply with Quote
As for the lambda expression, actually I might insert an existing symbol of type Action<>, so that doesnt make it any easier to resolve.
Go to Top of Page

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Aug 28 2020 :  10:35:33 AM  Show Profile  Reply with Quote
I have now tested something here, uninstalled VA and used VS plain for today. It seems that some of the completion list troubles have their origin in VS itself. I see some things happening that happen with VA enabled too, like those completions that overwrite useful suggestions, etc.
After turning off "Show Name Suggestions" in Intellisense, things got quieter. I will now turn on VA again and see where it goes.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16947 Posts

Posted - Aug 29 2020 :  08:50:35 AM  Show Profile  Reply with Quote
Just to complicate things a bit further, if you are starting to type the parameter(s) for a function that takes a Func<> parameter, it is also valid to pass in a delegate, so we cannot safely assume that you are creating a new Lambda statement:

https://stackoverflow.com/questions/2082615/pass-method-as-parameter-using-c-sharp#2082650

not that this helps to explain why you got a listbox when typing in a comment, that's just odd.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000