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
 Technical Support
 VA Snippets problem with comments and parameters
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Apr 17 2020 :  08:01:21 AM  Show Profile  Reply with Quote
When I define a snippet which contains comments and in the comments I use a parameter then I lose the ability to use completion/suggestion lists.
Let me explain with an example:

	/// <summary>
	/// Tests $name$ for correct assignment ($name$ b = another$name$;)
	/// </summary>
	public void TestCopyAssign()
	{
		TestDefaultAssign<$name$>();
	}


When you insert the snippet the parameter $name$ will be asked for and the caret is in the comment, thus you have no completion/suggestion available.
VA should place the caret in the first CODE location if possible.

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Apr 17 2020 :  09:03:36 AM  Show Profile  Reply with Quote
This makes sense, and I have put in a feature request for this:

case=142145

Are you aware that CTRL-SPACE will prompt VA to bring up a listbox of symbols when you are typing inside the comment, so you can still get help with the symbol name? It is an extra key press, but it helps for now.

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

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Apr 17 2020 :  09:09:46 AM  Show Profile  Reply with Quote
Nopes, not working at all.
When I insert the snippet, and immediately press Ctrl+Space, the VA Insert Snippet menu pops up. When I type a letter and press Ctrl+Space, the VS completion list for comments pops up.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Apr 18 2020 :  06:09:49 AM  Show Profile  Reply with Quote
OK, I have your latest settings and the Q7 test project you sent in to test the colouring problems you saw, case=142126

I have created the following C# snippet:

<VA_Snippet>
<Language>C#</Language>
<Title>Untitled</Title>
<Shortcut>test</Shortcut>
<Description />
<Code>/// <summary>
/// Tests $name$ for correct assignment ($name$ b = another$name$;)
/// </summary>
public void TestCopyAssign()
{
	TestDefaultAssign<$name$>();
}</Code>
</VA_Snippet>

if you copy the XML block you can paste it into the VA Snippet editor, to get the same test snippet. You can also copy a VA Snippet from the editor to get an XML block, useful for easily sharing snippets.

Having imported all of your settings, using VS2019 and VA 2366, and opening the Q7 test solution, I am sitting in the file "Q7AdministrativeContext.cs", line 53. Which is:

partial void OnModelCreatingPartial(ModelBuilder modelBuilder);

I add a line above, and type "test" to trigger this snippet. Once the snippet is inserted the first thing I press is CTRL-SPACE, and as you say, I am getting the insert snippet context menu, I will look into this next.

If I type "q" and then press CTRL-SPACE I now get a VA suggestion listbox, which seems much more sensible. I can get a VA completion list for comments, but only occasionally. It seems to depend on the letter I type, and if VA has any suggestions to offer based on this letter / letters. How similar is this to what you are seeing?

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

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Apr 18 2020 :  06:34:31 AM  Show Profile  Reply with Quote
Select any text in the editor and press CTRL-SPACE, you get the same snippet menu as you do when first pressing CTRL-SPACE after inserting the snippet. Since text is selected, VA thinks you might want to insert a snippet that uses $selected$, which is actually quite reasonable. It is a bit confusing in this situation though.

I have put in a feature request to handle this situation correctly:

case=142148

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