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
 Fix typos instead of interpreting them
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

et3d
Junior Member

11 Posts

Posted - Oct 25 2009 :  06:36:12 AM  Show Profile  Reply with Quote
When I use VA in C#, every typo I make is converted into a (typically very long) type name. For example (with a rare short name), typing 'strinf ' results in 'StringFormat '. This is a real productivity killer, because normally I'd just be able to continue typing and fix later, but here I have to stop, undo, make sure I type the correct letter, and then continue.

It would be nice if VA could detect that it's a typo and fix it, but if not, it should at least not insert some unwieldy name without an okay from me.

znakeeye
Tomato Guru

379 Posts

Posted - Oct 26 2009 :  05:40:43 AM  Show Profile  Reply with Quote
Word up! This is really painful :(
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18950 Posts

Posted - Oct 26 2009 :  09:42:18 AM  Show Profile  Reply with Quote
Are you seeing a listbox that is getting accepted, perhaps by space or tab?

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

et3d
Junior Member

11 Posts

Posted - Oct 26 2009 :  10:13:22 AM  Show Profile  Reply with Quote
Trying it now, I did see one, with just one option (the one that got filled in when I pressed space). I'll keep a lookout in the future to see if that's always the case.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18950 Posts

Posted - Oct 26 2009 :  10:32:11 AM  Show Profile  Reply with Quote
If this is related to listboxes then you could try changing these two IDE options:

IDE tools menu -> Options -> Text Editor -> C# -> IntelliSense -> Committed by typing the following characters:
IDE tools menu -> Options -> Text Editor -> C# -> IntelliSense -> Committed by pressing the space bar

to control when listboxes are accepted.

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

et3d
Junior Member

11 Posts

Posted - Oct 26 2009 :  10:44:54 AM  Show Profile  Reply with Quote
Thanks. I'll try that.
Go to Top of Page

et3d
Junior Member

11 Posts

Posted - Nov 10 2009 :  08:27:45 AM  Show Profile  Reply with Quote
Yes, seems like this is related to text boxes. If I turn off all method of automatically selecting things then this only happens when I press enter, though that can be annoying enough (for example, if I type "continuel<enter>" instead of "continue;<enter>", I get "QueryContinueDragEventHandler").

I still think it'd be nicer if Visual Assist recognised typos and offered the correct version as the default option. A simpler solution would be that when the word typed is far away from a single proposed replacement (such as in the case of "continuel"), it will be offered as the default option, so that the user will have to select the odd replacement specifically, in case it's indeed what he or she wanted.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18950 Posts

Posted - Nov 10 2009 :  1:57:40 PM  Show Profile  Reply with Quote
I am not sure how VA would be able to tell that you were making a typo. Firstly, if you have turned on:

VA Options -> Advanced -> Listboxes -> Allow Acronyms and Shorthand

then what you type can be quite "different" to the item you are trying to select in the listbox. It took me a while to get used to these, but now I use them all the time, and often type "odd parts" of the symbol name I want to use.

The second problem with figuring out typo's is when you are using the Create From Usage refactoring command. You will want to type an invalid symbol, and then create it.

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

et3d
Junior Member

11 Posts

Posted - Nov 10 2009 :  5:14:06 PM  Show Profile  Reply with Quote
There are quite a few ways for VA to tell something is a typo. For example, typos are typically nearby keys. Typos are also often close to words that make sense in the context, such as language keywords, variables available in scope, etc. In another direction, it's possible to track what a user is doing. If a user undoes a selection, it's obviously not the one intended, and VA can remember that for future use. For acronyms and shorthand, if the shorthand isn't an acronym and is quite long and doesn't make particular sense, as in the example I gave, where it uses a middle word plus one letter at the end of the last word, then it makes sense that it's not intended. I suggested offering it as a second option in the unlikely case it is.

I could probably think of another way or two to infer the user's intent. I'm not saying that these are trivial to implement, but they don't seem too difficult, either.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18950 Posts

Posted - Nov 17 2009 :  1:01:18 PM  Show Profile  Reply with Quote
This is an interesting idea, but it is not something we are going to try any time soon.

Firstly your comment about near by keys, this requires knowing what the users keyboard layout is. Assuming a standard layout for the country you are working in, which is quite a big assumption, this still requires VA to know the keyboard layout for each country. Plus you might have more than one keyboard scheme installed, and be swapping between them as you write either code or comments, so the keyboard scheme is likely to change. Easy examples where this is going to happen are Germany, China, Russia, Poland.

Tracking when someone uses undo, sometimes I use undo since I am selecting one of the VA "if" snippets, but I picked the wrong snippet. So I undo the typing and retype "if". I want to accept the same string the second time, but I want a different overloaded "if" snippet.

There is also the problem of pressing undo by mistake, or once to often, and having a correct selection removed, only to have to re-enter it again. Another reason for entering and undoing a selection is to type and accept a symbol name, so you can run Find References or an IDE Find in Files on the selection, or just to look at the context and definition fields for this selection and then undo it.

Currently we cannot see how to reliably separate real typo's from real world behaviours. All of these things, I know they happen since either I do them myself, or I have answered various tech support problems about them.

Turning off:

VA Options -> Advanced -> Listboxes -> Allow Acronyms and Shorthand

might help you with typo's, since listboxes will behave differently, but this will mean you need to do more manual typing.

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

et3d
Junior Member

11 Posts

Posted - Nov 17 2009 :  3:45:44 PM  Show Profile  Reply with Quote
Thanks for the detailed reply. If this continues to bother me I might be force to think about it some more. :)

I still think that it should be possible to at least offer the original text as the default option in some cases, and though it'd be a heuristic to determine when to offer it, I think it could be done in a satisfactory way.

Perhaps the easiest solution would be to have an additional option for "Allow Acronyms and Shorthand" that would pick up only beginning of words (in camel case). That could provide an option to use such shortcuts but reduce the number of wrongly detected ones. Might not fit everyone, but since it'd supplement the existing option, it might provide a good middle ground for people like me.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18950 Posts

Posted - Nov 18 2009 :  07:56:56 AM  Show Profile  Reply with Quote
From memory the guidance for camel case for C# is that short acronyms like XML should be kept in upper case in function names, which can make picking out the real first letters of words slightly tricky. Remember that there are a lot of different code standards in use, so what works for one person often does not work for someone else.

We are considering adding an option to give "priority" to upper case letters. So if you type upper case letters when filtering a listbox they would only match upper case letters in the listbox, while lower case letters would match both upper and lower case letters:

case=119

which might help in this situation.

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

et3d
Junior Member

11 Posts

Posted - Nov 18 2009 :  10:27:05 AM  Show Profile  Reply with Quote
I don't think it will help, since it will work the same as before for lower case, which is where the problems typically are (language keywords being transformed into long class names due to typos).

I feel you're trying to nitpick my suggestions, instead of using them as a springboard for a solution. Sure, you can always find cases where a given solution won't work, but providing a solution that works for some people is a whole lot better than not providing a solution because you don't have one that works for everyone.

Even the feature you mentioned with uppercase letter priority won't do much good for people whose naming convention is lowercase separated by underscores, or all uppercase. Does that mean that this feature should be shot down?

Okay, off the soapbox. Now, to the particular concern you mentioned, I don't think it's a real problem. Just treat every uppercase letter as a valid start of a word. The point isn't to pick real starts of a word, it's to reduce the number of matches that take letters from middle of words. It should be enough that it works in many cases (and not all) to reduce the number of unrelated matches that happen for typos.

Edited by - et3d on Nov 18 2009 10:27:31 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18950 Posts

Posted - Nov 30 2009 :  11:15:26 AM  Show Profile  Reply with Quote
Apologies for the delay in getting back to you about this.

I have discussed this idea with our developers, but we are not sure how to try and do this without causing more problems than we fix. From a support perspective you are asking for:

"I typed foo but VA entered bar"

Now I agree this is a silly and extreme example, but this is how it is likely to feel when it goes wrong, and someone is reporting an unwanted behaviour in VA.

None of us are sure how to tell the difference between "correct" and "incorrect" typing. Remember that you are assuming that a given listbox lists all valid options at a given point in code. If this was true, and there was no create from usage command, then anything that is not in the listbox can be considered a typo. However this is no always true, and there is a create from usage command.

I know that a real world usage of VA is to type the "wrong" symbol into some code, use Alt-g or perhaps the HCB on this symbol to get information about it, and then undo it. I know this since this method comes up in discussion on this forum about this.

But if you do this, then undo the typing, then to this "learn what I am doing" rule it looks like a typo, even though it was not.

I know this sounds like I am being picky, but I am also the first line of support when our users don't like how something works. So I have learned to be very wary of anything that might "get in the way".

I am happy to discuss this, and see if we can see a way to make a fairly accurate guess at what is a typo and what is not a typo.

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:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000