@@ -251,6 +251,7 @@ ref completionItems.AsRef(),
251251 context ,
252252 tagHelpers ,
253253 displayText ,
254+ descriptionInfo ,
254255 commitChars ) ;
255256
256257 AddCompletionItemWithUsingDirective ( ref completionItems . AsRef ( ) , context , commitChars , displayText , descriptionInfo ) ;
@@ -327,23 +328,25 @@ private static void AddCompletionItemWithRequiredAttributesSnippet(
327328 RazorCompletionContext context ,
328329 IEnumerable < TagHelperDescriptor > tagHelpers ,
329330 string displayText ,
331+ AggregateBoundElementDescription descriptionInfo ,
330332 ImmutableArray < RazorCommitCharacter > commitChars )
331333 {
332- // If snippets are supported and the component has EditorRequired attributes, add a snippet completion item
333- if ( context . Options . SnippetsSupported )
334+ // If snippets are not supported, exit early
335+ if ( ! context . Options . SnippetsSupported )
334336 {
335- if ( TryGetEditorRequiredAttributesSnippet ( tagHelpers , displayText , out var snippetText ) )
336- {
337- var tagHelperDescriptions = tagHelpers . SelectAsArray ( BoundElementDescriptionInfo . From ) ;
338- var snippetCompletionItem = RazorCompletionItem . CreateTagHelperElement (
339- displayText : SR . FormatComponentCompletionWithRequiredAttributesLabel ( displayText ) ,
340- insertText : snippetText ,
341- descriptionInfo : new ( tagHelperDescriptions ) ,
342- commitCharacters : commitChars ,
343- isSnippet : true ) ;
344-
345- completionItems . Add ( snippetCompletionItem ) ;
346- }
337+ return ;
338+ }
339+
340+ if ( TryGetEditorRequiredAttributesSnippet ( tagHelpers , displayText , out var snippetText ) )
341+ {
342+ var snippetCompletionItem = RazorCompletionItem . CreateTagHelperElement (
343+ displayText : SR . FormatComponentCompletionWithRequiredAttributesLabel ( displayText ) ,
344+ insertText : snippetText ,
345+ descriptionInfo : descriptionInfo ,
346+ commitCharacters : commitChars ,
347+ isSnippet : true ) ;
348+
349+ completionItems . Add ( snippetCompletionItem ) ;
347350 }
348351 }
349352
0 commit comments