Slow code snippet insert

Jaime Fuhr 21 Reputation points
2022-11-17T15:21:54.787+00:00

I use code snippets in Visual Studio for C# and have no problems. CTRL K + X brings up the menu and the snippet is instantly inserted.

However, when I try to insert an HTML snippet onto a webform page, there is a 5 second delay before it appears.

Here is my code. Any ideas on what is causing the delay? I've updated to latest version of VS2022.

<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">  
	<CodeSnippet Format="1.1.0">  
		<Header>  
			<Title>Horizontal Form</Title>  
			<Author>J.Fuhr</Author>  
			<Description>Markup snippet for a horizontal form row</Description>  
			<SnippetTypes>  
				<SnippetType>Expansion</SnippetType>  
			</SnippetTypes>  
			<Shortcut>bs5_horizontalFormRow</Shortcut>  
		</Header>  
		<Snippet>  
			<Declarations>  
				<Literal>  
					<ID>label</ID>  
				</Literal>  
			</Declarations>  
			<Code Language="HTML">  
				<![CDATA[<div class="row mb-3">  
                        <label class="col-sm-2 col-form-label">$label$</label>  
                        <div class="col-sm-10">  
  
                        </div>  
                    </div>]]>  
			</Code>  
		</Snippet>  
	</CodeSnippet>  
	<CodeSnippet Format="1.1.0">  
		<Header>  
			<Title>Standard Form</Title>  
			<Author>J.Fuhr</Author>  
			<Description>Markup snippet for a standard form row</Description>  
			<Shortcut>bs5_formRow</Shortcut>  
			<SnippetTypes>  
				<SnippetType>Expansion</SnippetType>  
			</SnippetTypes>  
		</Header>  
		<Snippet>  
			<Declarations>  
				<Literal>  
					<ID>COLSIZE</ID>  
					<Default>auto</Default>  
				</Literal>  
				<Literal>  
					<ID>label</ID>  
				</Literal>  
			</Declarations>  
			<Code Language="HTML">  
				<![CDATA[<div class="row mb-3">  
                            <label class="form-label">$label$</label>  
                            <div class="col-$COLSIZE$">  
  
                            </div>  
                        </div>]]>  
			</Code>  
		</Snippet>  
	</CodeSnippet>  
	<CodeSnippet Format="1.1.0">  
		<Header>  
			<Title>Equal Height Columns with Card</Title>  
			<Author>J.Fuhr</Author>  
			<Description>Markup snippet for a standard form row</Description>  
			<SnippetTypes>  
				<SnippetType>Expansion</SnippetType>  
			</SnippetTypes>  
		</Header>  
		<Snippet>  
			<Code Language="HTML">  
				<![CDATA[ <div class="row">  
        <div class="col-2 d-flex flex-column flex-shrink-0 p-2 full-screen-card">  
            <div class="card card-body flex-fill">  
			</div>  
		</div>  
		 <div class="col-10 d-flex flex-column flex-shrink-0 p-2 full-screen-card">  
            <div class="card card-body flex-fill">  
			</div>  
		</div>  
</div>]]>  
			</Code>  
		</Snippet>  
	</CodeSnippet>  
</CodeSnippets>  
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
3,143 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Taylor 41,551 Reputation points
    2022-11-17T15:39:24.773+00:00

    This has nothing to do with your snippet and is replicable on any snippet in the webforms designer. You should use the Report a Problem tool in VS to report the issue to MS along with the repo steps. I can replicate it myself.

    Note that you should confirm whether you're using the legacy web designer or the new web live preview designer (Tools \ Options -> Web Forms Designer). It could also be related to an extension.


0 additional answers

Sort by: Most helpful