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
 Feature Requests
 Suggestion improvements
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Sep 03 2020 :  04:35:25 AM  Show Profile  Reply with Quote
I realized that the suggestions that VA makes, many times are "guesses" and not based on what I usually do. The best example are class members of type DateTime.
I can write 10 times "this.CurrentTime = " and 10 times VA will suggest "new DateTime" although 9 out of 10 times what I write there is "DateTime.Now". A little bit of selection counting could resolve that.

So I would expect that VA get smart over time and starts suggesting what I really want.
And now this brings me to a an smaller issues with the suggestions: they never include static members that fit the bill (like DateTime.Now) Not sure if that is a bug or just an oversight. In the case of DateTime, VA only offers "new DateTime" and "null"

feline
Whole Tomato Software

United Kingdom
16896 Posts

Posted - Sep 03 2020 :  07:39:33 AM  Show Profile  Reply with Quote
Normal suggestions are designed to be aware of how often you have typed something, and to respond. The down side is that they are not so "clever" or context aware.

Here you are seeing a Smart Suggestion, which are designed to be type specific, but by default they only offer basic options. You can add a snippet to extend the options suggested, on a type by type basis, so in this case, open your VA Snippet editor and paste in the following XML to add a smart suggestion entry for the C# DateTime type, adding the Now method:

<VA_Snippet>
<Language>C#</Language>
<Title>SuggestionsForType DateTime</Title>
<Shortcut />
<Description />
<Code>DateTime.Now</Code>
</VA_Snippet>


This will take effect as soon as you accept the new snippet.

This is listed in the documentation, but I am not sure how many people realise you can do this:

https://support.wholetomato.com/default.asp?W172

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

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Sep 04 2020 :  06:10:18 AM  Show Profile  Reply with Quote
Snippet works fine for DateTime.Now, yet its not the perfect solution. Having all static methods included in the suggestions would be.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16896 Posts

Posted - Sep 04 2020 :  11:24:28 AM  Show Profile  Reply with Quote
Are you sure you really want all static methods? Going to the class declaration for DateTime in C# in VS2019, there are 33 different static methods for this class. I didn't check the interfaces it inherits, but I doubt you want all of these coming up as standard suggestions. We have 9 overloaded operators for example, which aren't something you normally want in the listbox.

Other classes may well have even more static members.

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

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Sep 04 2020 :  11:28:15 AM  Show Profile  Reply with Quote
Hahaha, yeah, you are right actually. Still, would be nice to have the popular ones showing up. Like current intellisense actually does. But then again, I guess they have more statistical data available.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16896 Posts

Posted - Sep 04 2020 :  1:56:37 PM  Show Profile  Reply with Quote
I have put in a feature request to see if we can pull up the list of "likely" entries the IDE has, and add these to the listbox:

case=142841

it depends on how available, if it is available at all, this information is from the IDE. Worth seeing what our developers make of it.

For now, at least the snippets let you address the main cases you keep running into.

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