提交 23d559a7 编写于 作者: R Ravi Chande

Don't run VB enum completion after dot

Members after dot are now provided by SymbolCompletionProvider. Fixes
上级 ae034955
......@@ -467,8 +467,20 @@ End Class
Await VerifyNoItemsExistAsync(markup)
End Function
<Fact, Trait(Traits.Feature, Traits.Features.Completion)>
<WorkItem(12733, "https://github.com/dotnet/roslyn/issues/12733")>
Public Async Function NotAfterDot() As Task
Dim markup = <Text>Module Module1
Sub Main()
Do Until (System.Console.ReadKey.Key = System.ConsoleKey.$$
Loop
End Sub
End Module</Text>.Value
Await VerifyNoItemsExistAsync(markup)
End Function
Friend Overrides Function CreateCompletionProvider() As CompletionProvider
Return New EnumCompletionProvider()
End Function
End Class
End Namespace
\ No newline at end of file
End Namespace
......@@ -7511,5 +7511,20 @@ End Class
Await VerifyItemExistsAsync(text, "x")
End Function
<WorkItem(153633, "https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/153633")>
<Fact, Trait(Traits.Feature, Traits.Features.Completion)>
Public Async Function EnumMembers() As Task
Dim text =
<code><![CDATA[
Module Module1
Sub Main()
Do Until (System.Console.ReadKey.Key = System.ConsoleKey.$$
Loop
End Sub
End Module
]]></code>.Value
Await VerifyItemExistsAsync(text, "A")
End Function
End Class
End Namespace
......@@ -18,6 +18,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
Return SpecializedTasks.EmptyEnumerable(Of ISymbol)()
End If
If context.TargetToken.IsKind(SyntaxKind.DotToken) Then
Return SpecializedTasks.EmptyEnumerable(Of ISymbol)()
End If
Dim typeInferenceService = context.GetLanguageService(Of ITypeInferenceService)()
Dim enumType = typeInferenceService.InferType(context.SemanticModel, position, objectAsDefault:=True, cancellationToken:=cancellationToken)
......@@ -44,6 +48,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
Return SpecializedTasks.EmptyEnumerable(Of ISymbol)()
End If
If context.TargetToken.IsKind(SyntaxKind.DotToken) Then
Return SpecializedTasks.EmptyEnumerable(Of ISymbol)()
End If
Dim typeInferenceService = context.GetLanguageService(Of ITypeInferenceService)()
Dim span = New TextSpan(position, 0)
Dim enumType = typeInferenceService.InferType(context.SemanticModel, position, objectAsDefault:=True, cancellationToken:=cancellationToken)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册