File tree Expand file tree Collapse file tree 2 files changed +0
-74
lines changed
src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion
test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion Expand file tree Collapse file tree 2 files changed +0
-74
lines changed Original file line number Diff line number Diff line change 44using System ;
55using System . Collections . Generic ;
66using System . Collections . Immutable ;
7- using System . Diagnostics ;
87using System . Diagnostics . CodeAnalysis ;
98using System . Linq ;
109using Microsoft . AspNetCore . Razor ;
@@ -38,11 +37,6 @@ internal class RazorCompletionListProvider(
3837 HashSet < string > ? existingCompletions ,
3938 RazorCompletionOptions completionOptions )
4039 {
41- if ( ! IsApplicableTriggerContext ( completionContext ) )
42- {
43- return null ;
44- }
45-
4640 var reason = completionContext . TriggerKind switch
4741 {
4842 CompletionTriggerKind . TriggerForIncompleteCompletions => CompletionReason . Invoked ,
@@ -262,24 +256,4 @@ internal static bool TryConvert(
262256 completionItem = null ;
263257 return false ;
264258 }
265-
266- // Internal for testing
267- internal static bool IsApplicableTriggerContext ( CompletionContext context )
268- {
269- if ( context is not VSInternalCompletionContext vsCompletionContext )
270- {
271- Debug . Fail ( "Completion context should always be converted into a VSCompletionContext (even in VSCode)." ) ;
272-
273- // We do not support providing completions on delete.
274- return false ;
275- }
276-
277- if ( vsCompletionContext . TriggerKind == CompletionTriggerKind . TriggerForIncompleteCompletions )
278- {
279- // For incomplete completions we want to re-provide information if we would have originally.
280- return true ;
281- }
282-
283- return true ;
284- }
285259}
Original file line number Diff line number Diff line change @@ -61,54 +61,6 @@ private static IRazorCompletionItemProvider[] GetCompletionProviders()
6161 new TagHelperCompletionProvider ( new TagHelperCompletionService ( ) )
6262 ] ;
6363
64- [ Fact ]
65- public void IsApplicableTriggerContext_Deletion_ReturnsTrue ( )
66- {
67- // Arrange
68- var completionContext = new VSInternalCompletionContext ( )
69- {
70- InvokeKind = VSInternalCompletionInvokeKind . Deletion
71- } ;
72-
73- // Act
74- var result = RazorCompletionListProvider . IsApplicableTriggerContext ( completionContext ) ;
75-
76- // Assert
77- Assert . True ( result ) ;
78- }
79-
80- [ Fact ]
81- public void IsApplicableTriggerContext_Explicit_ReturnsTrue ( )
82- {
83- // Arrange
84- var completionContext = new VSInternalCompletionContext ( )
85- {
86- InvokeKind = VSInternalCompletionInvokeKind . Explicit
87- } ;
88-
89- // Act
90- var result = RazorCompletionListProvider . IsApplicableTriggerContext ( completionContext ) ;
91-
92- // Assert
93- Assert . True ( result ) ;
94- }
95-
96- [ Fact ]
97- public void IsApplicableTriggerContext_Typing_ReturnsTrue ( )
98- {
99- // Arrange
100- var completionContext = new VSInternalCompletionContext ( )
101- {
102- InvokeKind = VSInternalCompletionInvokeKind . Typing
103- } ;
104-
105- // Act
106- var result = RazorCompletionListProvider . IsApplicableTriggerContext ( completionContext ) ;
107-
108- // Assert
109- Assert . True ( result ) ;
110- }
111-
11264 [ Fact ]
11365 public void TryConvert_Directive_ReturnsTrue ( )
11466 {
You can’t perform that action at this time.
0 commit comments