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
 Automatically commit #include suggestions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

matthewm
New Member

7 Posts

Posted - Oct 14 2011 :  3:03:55 PM  Show Profile  Reply with Quote
I've been using VAX for a while now and am quite pleased with it. One thing is bugging me however. In VS2010 without VAX, if you type #include and start typing a file path, you get intellisense with suggested file names and folders, and if you close the path by typing > or ", the current selection is automatically inserted. With VAX enabled however, this automatic insertion no longer happens: you have to press Tab to insert the file name manually. This is the case even if the "Any character not valid in a symbol" option is checked under "Selections committed with:".

The same goes for inserting the #include directive in the first place. Typing "#in" pops up intellisense, but pressing space after that leaves you with just "#in ", again even though the autocommit option is on according to which this should have been expanded to "#include ". The same goes for all other preprocessor directives (#define, #pragma, ...).

Hence I would like to request this functionality to be restored.

Edited by - matthewm on Oct 14 2011 5:57:35 PM

sean
Whole Tomato Software

USA
2817 Posts

Posted - Oct 14 2011 :  9:54:43 PM  Show Profile  Reply with Quote
Thanks for pointing out the discrepancy with VS2010 default behavior of #include completion. The VA feature has been around a long time and we hadn't noticed that difference. It will be fixed in the next build. case=61997

Regarding the the #in, that is a VA Snippet which should insert [#include ""]. Not clear what should happen to the space that is being used to commit the item? We can't as a rule eat any character used to commit a snippet...

You can disable inclusion of VA Snippets in listboxes on the Advanced | Suggestions page of the VA Options dialog.
Go to Top of Page

matthewm
New Member

7 Posts

Posted - Oct 15 2011 :  07:04:47 AM  Show Profile  Reply with Quote
Thanks for the quick reply, glad to see the path autocomplete will be fixed.

As for #include, the thing is that this snippet suggestion *can't* be committed by pressing space; you have to press Tab or Enter. In fact there seems to be some inconsistency regarding this: snippets like "b" -> "bool" and "r" -> "return" do get committed when pressing any non-symbolic character like space, parenthesis, semicolon etc. But others, like #in -> #include "" and #d -> #define, don't. So while I can type "r 1;" and have this expanded to "return 1;", I can't type "#d A B" to have it expanded to "#define A B".

On the other hand, I do realize that committing snippet suggestions with space is not always desirable, e.g. you don't want "if() { } else { }" to be inserted when you were just going to type "if ( a )".

I'm guessing that the decision whether a snippet can be inserted using other characters than Tab and Enter is made inside VAX according to some specific criteria depending on the snippet content. Maybe this could be made configurable by the user instead?
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Oct 15 2011 :  12:55:25 PM  Show Profile  Reply with Quote
True, commit characters for VA Snippets are dependent upon snippet content. If the snippet source contains any of these characters "{}[],:;+-*/%&|^!~=<>?#@'\\"\\\\.() \\t\\r" then only tab or enter will commit. You've certainly made a case that # should not be in that list. case= 62003. However note that the #d snippet results in "#define " by default. You will want to remove the trailing space in the source. Many of the default snippets are like that.

Also note that the default #in snippet just doesn't make sense to complete with space. Try committing that snippet with enter or tab to see what it does. You can modify it it to suit completion with space - once the # rule is changed.

Finally, the commit criteria is modified after you press down in the listbox. The protections we put in place to prevent inadvertent commits are reduced. For example, type #d. Press down. Now press space to commit. Silly example, but if you have many snippets with the same shortcut then it makes sense.

Oh yeah - suggestions that come from "SuggestionsForType..." snippets don't necessarily follow the same rules.
Go to Top of Page

matthewm
New Member

7 Posts

Posted - Oct 15 2011 :  1:31:23 PM  Show Profile  Reply with Quote
> If the snippet source contains any of these characters "{}[],:;+-*/%&|^!~=<>?#@'\\"\\\\.() \\t\\r" then only tab or enter will commit.
Aha, good to know.

Thanks again, I'm looking forward to the next build
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Dec 16 2011 :  2:11:39 PM  Show Profile  Reply with Quote
case=61997 is fixed in build 1862
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