Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixes for Roslyn.Services.Editor2.UnitTests
  • Loading branch information
MaStr11 committed Jan 24, 2018
commit bff1e8565c1212f2667ad7c03608e49a374034ed
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Imports System.Globalization
Imports System.Threading
Imports System.Threading.Tasks
Imports Microsoft.CodeAnalysis.Completion
Imports Microsoft.CodeAnalysis.CSharp
Imports Microsoft.CodeAnalysis.Editor.Commands
Imports Microsoft.CodeAnalysis.Editor.CSharp.Formatting
Imports Microsoft.CodeAnalysis.Editor.UnitTests.Extensions
Expand Down Expand Up @@ -2761,10 +2762,10 @@ class Program
state.SendInvokeCompletionList()
Await state.WaitForAsynchronousOperationsAsync()
Await state.AssertSelectedCompletionItem(description:=
"(extension) 'a[] System.Collections.Generic.IEnumerable<'a>.ToArray<'a>()
$"({ CSharpFeaturesResources.extension }) 'a[] System.Collections.Generic.IEnumerable<'a>.ToArray<'a>()

Anonymous Types:
'a is new { int x }")
{ FeaturesResources.Anonymous_Types_colon }
'a { FeaturesResources.is_ } new {{ int x }}")
End Using
End Function

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2471,10 +2471,10 @@ End Class
state.SendInvokeCompletionList()
Await state.WaitForAsynchronousOperationsAsync()
Await state.AssertSelectedCompletionItem(description:=
"<Extension> Function IEnumerable(Of 'a).ToArray() As 'a()
$"<{ VBFeaturesResources.Extension }> Function IEnumerable(Of 'a).ToArray() As 'a()

Anonymous Types:
'a is New With { .x As Integer }")
{ FeaturesResources.Anonymous_Types_colon }
'a { FeaturesResources.is_ } New With {{ .x As Integer }}")
End Using
End Function

Expand All @@ -2494,10 +2494,10 @@ End Class
state.SendInvokeCompletionList()
Await state.WaitForAsynchronousOperationsAsync()
Await state.AssertSelectedCompletionItem(description:=
"<Extension> Function IEnumerable(Of 'a).ToArray() As 'a()
$"<{ VBFeaturesResources.Extension }> Function IEnumerable(Of 'a).ToArray() As 'a()

Anonymous Types:
'a is New With { Key .x As Integer }")
{ FeaturesResources.Anonymous_Types_colon }
'a { FeaturesResources.is_ } New With {{ Key .x As Integer }}")
End Using
End Function

Expand Down Expand Up @@ -2669,7 +2669,7 @@ End Class
End Using
End Function

<WpfFact, Trait(Traits.Feature, Traits.Features.Completion)>
<WpfFact, Trait(Traits.Feature, Traits.Features.Completion)>
Public Async Function TestSnippetsNotExclusiveWhenAlwaysShowing() As Task
Dim snippetProvider As CompletionProvider =
New VisualStudio.LanguageServices.VisualBasic.Snippets.
Expand All @@ -2692,7 +2692,7 @@ End Class
SnippetsRule.AlwaysInclude)

state.SendInvokeCompletionList()
await state.WaitForAsynchronousOperationsAsync()
Await state.WaitForAsynchronousOperationsAsync()
Assert.True(state.CompletionItemsContainsAll({"x", "Shortcut"}))
End Using
End Function
Expand Down Expand Up @@ -2949,20 +2949,20 @@ End Class
End Function

<ExportLanguageService(GetType(ISnippetInfoService), LanguageNames.VisualBasic), System.Composition.Shared>
Friend Class MockSnippetInfoService
Implements ISnippetInfoService

Public Function GetSnippetsAsync_NonBlocking() As IEnumerable(Of SnippetInfo) Implements ISnippetInfoService.GetSnippetsIfAvailable
Return SpecializedCollections.SingletonEnumerable(New SnippetInfo("Shortcut", "Title", "Description", "Path"))
End Function

Public Function ShouldFormatSnippet(snippetInfo As SnippetInfo) As Boolean Implements ISnippetInfoService.ShouldFormatSnippet
Return False
End Function

Public Function SnippetShortcutExists_NonBlocking(shortcut As String) As Boolean Implements ISnippetInfoService.SnippetShortcutExists_NonBlocking
Return shortcut = "Shortcut"
End Function
End Class
End Class
Friend Class MockSnippetInfoService
Implements ISnippetInfoService

Public Function GetSnippetsAsync_NonBlocking() As IEnumerable(Of SnippetInfo) Implements ISnippetInfoService.GetSnippetsIfAvailable
Return SpecializedCollections.SingletonEnumerable(New SnippetInfo("Shortcut", "Title", "Description", "Path"))
End Function

Public Function ShouldFormatSnippet(snippetInfo As SnippetInfo) As Boolean Implements ISnippetInfoService.ShouldFormatSnippet
Return False
End Function

Public Function SnippetShortcutExists_NonBlocking(shortcut As String) As Boolean Implements ISnippetInfoService.SnippetShortcutExists_NonBlocking
Return shortcut = "Shortcut"
End Function
End Class
End Class
End Namespace
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ End Class
</Document>
</Project>
</Workspace>,
"(ExampleClass Events)",
$"(ExampleClass { FeaturesResources.Events })",
Function(items) items.First(Function(i) i.Text = "ExampleEvent"),
<Result>
Public Class ExampleClass
Expand Down