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
 Enhancement to "Completion Overwrite"
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic Next Topic  

lex
Senior Member

29 Posts

Posted - Jun 06 2019 :  5:50:49 PM  Show Profile  Reply with Quote
From the documentation on CompletionOverwriteBehavior:
quote:
When you accept from an enhanced listbox immediately before, or in the middle of, a symbol, Visual Assist replaces the text to the right of the caret unless that text is itself a known symbol.
I like that behavior for the most part but it's not obvious if the completion is going to overwrite or not. Sometimes it overwrites when I thought it wouldn't, and sometimes I won't even accept because I don't want it to overwrite.

Here are two suggestions to enhance this feature:

  1. Highlight the part of the text that will be overwritten if a completion is accepted.
  2. a) Add a shortcut for inverting the default behavior (essentially toggling between overwrite and insert). OR
    b) Add a shortcut for accepting a completion with inverted behavior (like Shift+Enter).
    (For both a and b the default behavior should be restored when the listbox is closed)

accord
Whole Tomato Software

United Kingdom
3167 Posts

Posted - Jun 07 2019 :  7:15:38 PM  Show Profile  Reply with Quote
Are you aware of the following setting?
https://docs.wholetomato.com/default.asp?W640
Go to Top of Page

lex
Senior Member

29 Posts

Posted - Jun 08 2019 :  05:33:38 AM  Show Profile  Reply with Quote
quote:
Originally posted by accord

Are you aware of the following setting?
https://docs.wholetomato.com/default.asp?W640



Yes. I don't want to turn overwrite always on or off. The default behavior does the "correct" thing most of the time.

To compare with other IDEs:
- Eclipse has the highlight option (1) and a toggle shortcut (2a).
- IntelliJ has two explicit shortcuts (similar to 2b). By default it inserts on Enter and overwrites on Tab.



Edited by - lex on Jun 08 2019 05:35:20 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16004 Posts

Posted - Jun 10 2019 :  11:47:21 AM  Show Profile  Reply with Quote
It is not always obvious what is going to happen when using Completion Override, and it can confuse people as to why VA does what it does, so some form of visual feedback to tell you what VA is thinking makes sense here. So highlighting what will be removed makes some sense, so I have put in a feature request for this:

case=140777

Is this a situation you often run into? I am not sure about the modifier key for the listbox. If you are used to the highlighting, and recognise what it means, then the modifier key will make some sense, but generally listboxes do not respond to modifier keys, so this is not really going to be obvious or expected behaviour.

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

lex
Senior Member

29 Posts

Posted - Jun 10 2019 :  2:22:33 PM  Show Profile  Reply with Quote
I agree that a visual feedback would be the most helpful of those.

Unexpected overwrite happens "often enough" and most of the times it's not a bug in VA. For example a symbol could be unknown because it's not included yet, so VA correctly overwrites it even though that's not what I was expecting.

But it's also fairly easy to produce buggy behavior in VA. Create a new CMake project in VS2019. Define a local integer then make VA overwrite.
int main()
{
  int foobar;
  errn|foobar = 4;
}     ^
A listbox will popup at this point and pressing enter to accept will replace foobar with errno. Picture below to make it clearer.




Edited by - lex on Jun 10 2019 2:23:29 PM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16004 Posts

Posted - Jun 11 2019 :  10:23:48 AM  Show Profile  Reply with Quote
OK... I am seeing the same problem, but so far it looks like it is specific to both a CMake project, and the symbol "errno". I am not seeing this problem with a different project type, or some other symbol names.

Are you mainly seeing this bug in CMake projects, or are you seeing it in other project types as well? I would not expect the project type to matter here, but somehow it seems it does.

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

lex
Senior Member

29 Posts

Posted - Jun 11 2019 :  1:06:32 PM  Show Profile  Reply with Quote
I get the same bug with many other global symbols, errno was just a random example. Try typing "atan" and then accept "atan2f", or "wcou" and accept "wcout".

I did a quick test in a regular (pure C) project and got the same bug with "atan2f" and "wcout", but not with "errno" for whatever reason.

Edit. Just realized that "wcout" is a C++ symbol that can't be visible in the C project I tested with. In other words: an unknown symbol replaced a known symbol in that case.

Edited by - lex on Jun 11 2019 1:16:06 PM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16004 Posts

Posted - Jun 11 2019 :  3:44:02 PM  Show Profile  Reply with Quote
I have put in a bug report for the errno case, which I am seeing, but so far only in CMake projects:

case=140779

For me, there is an interesting pattern here. While the bug is happening, if I place the caret into "errno" VA does not show anything in its context and definition fields, these are normally at the top of the editor window and are where the alt-m list appears from.

If I use "alt-g" on "errno" VA takes me to the file "errno.h". After doing this the bug no longer happens, and when I place the caret into "errno" I am seeing the definition of this macro in the context and definition fields.

Can you see if the same pattern holds for you please?

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

lex
Senior Member

29 Posts

Posted - Jun 11 2019 :  5:51:56 PM  Show Profile  Reply with Quote
Yes! The exact same thing happens for me with both "errno" and "wcout".

Functions still overwrites, and type names created with typedef too. Here's the result after accepting various suggestions:

|MY_SYMBOL; // Starting with this for each case below.
^

errno|MY_SYMBOL; // Correct after "loading" errno with Alt+G.
     ^

wcout|MY_SYMBOL; // Correct after "loading" wcout with Alt+G.
     ^

size_t|; // Incorrect. Typedef.
      ^

string|; // Incorrect. Typedef.
      ^

basic_string|MY_SYMBOL; // Correct. "Real" type.
            ^

atan2f(|); // Incorrect. Functions always overwrite.
       ^


Edited by - lex on Jun 11 2019 5:56:40 PM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16004 Posts

Posted - Jun 12 2019 :  2:35:25 PM  Show Profile  Reply with Quote
I am seeing the same behavior with these tests. I have now created a simple example of each of the C++ project types that VS2019 is offering me, and the only other project type I can reproduce this problem in is a Shared Items Project, but in this case the only thing the solution contains is the single shared items project, and one cpp file. So a rather random test situation.

Are you seeing this problem in any other project types, or just in CMake projects?

If you look in the VA Options dialog, at the "C/C++ Directories" page, what platform do you have this set to for the system include files, and are any directories being listed?

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

lex
Senior Member

29 Posts

Posted - Jun 12 2019 :  3:59:56 PM  Show Profile  Reply with Quote
The first two (errno and wcout) only happens with CMake projects before using Alt+G.
The others happens in all projects types I've tested.

I used these templates: "CMake Project", "Console App", "Makefile Project", and "Empty Project". Started with the same hello world sample in all projects.


The platform is set to "Custom" and the list is empty. I tried changing "Platform" to "Project defined" but that didn't do anything.
Earlier I also tried switching between VA and Default intellisense options in the "Enhanced Listboxes" page, with no difference.

I'm running VS2019 Community with VA version 2333 (personal license). No other extensions installed.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16004 Posts

Posted - Jun 17 2019 :  4:26:54 PM  Show Profile  Reply with Quote
OK, confirmed. I really did not see that one coming, but yes, setting up a clean sensible test, typedefs are always replacing the known symbol after the caret when they are accepted, and so are function calls. Sorry about this, and no wonder the behaviour of VA seems to random here. I have put in a bug report for this:

case=140801

zen is the art of being at one with the two'ness
Go to Top of Page
   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