/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Compilers/Test/Utilities/VisualBasic/DiagnosticExtensions.vb
34 строки
1 KB
Jonathon Marolf
update headers
23 янв 2020, 04:01
Не верифицирован
23 янв 2020, 04:01
91571a3
Код
Авторство
О чём код?
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Collections.Immutable Imports System.Runtime.CompilerServices Imports System.Threading Imports Microsoft.CodeAnalysis.Test.Utilities Imports Microsoft.CodeAnalysis.Text Namespace Global.Microsoft.CodeAnalysis.VisualBasic Friend Module DiagnosticsExtensions <Extension> Friend Function VerifyDiagnostics(c As VisualBasicCompilation, ParamArray expected As DiagnosticDescription()) As VisualBasicCompilation Dim diagnostics = c.GetDiagnostics(CompilationStage.Compile) diagnostics.Verify(expected) Return c End Function <Extension> Friend Function GetDiagnosticsForSyntaxTree(c As VisualBasicCompilation, stage As CompilationStage, tree As SyntaxTree, Optional filterSpan As TextSpan? = Nothing) As ImmutableArray(Of Diagnostic) Return c.GetDiagnosticsForSyntaxTree(stage, tree, filterSpan, includeEarlierStages:=True, cancellationToken:=CancellationToken.None) End Function ' TODO: Figure out how to return a localized message using VB '<Extension()> 'Public Function ToLocalizedString(id As MessageID) As String ' Return New LocalizableErrorArgument(id).ToString(Nothing, Nothing) 'End Function End Module End Namespace