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
 Make "insert closing" configurable or revert
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Jul 28 2023 :  05:57:29 AM  Show Profile  Reply with Quote
This latest feature drives me crazy, whenever I type a ' or " now I always get two, independent of context or surrounding characters.
I love the closing brackets, but those two chars should be inserted as a double ONLY when there is nothing else around except whitespace or EOL/BOL.
I am this '' close to disabling the feature altogether.

feline
Whole Tomato Software

United Kingdom
19023 Posts

Posted - Jul 28 2023 :  06:34:49 AM  Show Profile  Reply with Quote
Is this a recent change in behaviour? Your description suggests it is.

What sort of situations are you seeing this happen in, when you feel it should not be happening?

Using VS2022 and VA 2491.0, C++, with the perhaps overly simple test case:

void test|FuncBa|sic()
{
	std::string fred = "hello| wor|ld";
	fred.append("-", 3)|;
	std::string *|pName;
	p|Name;
}


I have tried typing either " or ' at each of the positions marked with | and only a single character is inserted.

Yet when typing the line:

pName = "fred";

I get the closing double quotes inserted as expected.

So I am wondering if you are running into a more context specific problem.

More generally, we are considering letting you turn this feature on and off for individual characters:

case=82774

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

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Jul 28 2023 :  06:58:07 AM  Show Profile  Reply with Quote
I think that handling of certain cases has changed, as before I never noticed this annoyance.



As you can see in this clip, when at the beginning of a word, it does insert double quotes, same at the end, sometimes.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19023 Posts

Posted - Jul 28 2023 :  09:12:57 AM  Show Profile  Reply with Quote
I got the same results as you are showing in C# in VA 2420, so it doesn't seem to be a new change. Testing this, there is a difference as to how this works in C++ vs C#, so that's not ideal.

In C++ if the caret is at the start of a symbol then only a single " or ' is inserted, while in C# two are inserted.

case=149815

Assuming you are mainly looking to wrap a symbol in " rather than ' you can create a new VA Snippet and set the surround with to " and the body to:

"$selected$"

if you are interested you can select the following XML and paste it into the VA Snippet editor to add this snippet to your system:

<VA_Snippet>
<Language>C#</Language>
<Title />
<Shortcut>SurroundWith="</Shortcut>
<Description />
<Code>"$selected$"</Code>
</VA_Snippet>

strangely though the matching snippet, to surround with ' isn't working for me.

case=149816

Just to add to the variables at work here, there is no need for the snippets since in VS2022, C++, selecting a symbol and pressing either ' or " surrounds it, even with VA disabled in the extension manager.

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