/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/Extensions/SymbolDisplayPartExtensions.vb
29 строк
1 KB
dotnet-bot
Apply FixAll in solution for IDE0005 (fixes VB projects in the solution)
07 апр 2020, 20:47
07 апр 2020, 20:47
b2ee853
Код
Авторство
О чём код?
' 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.Runtime.CompilerServices Namespace Microsoft.CodeAnalysis.VisualBasic.Extensions Friend Module SymbolDisplayPartExtensions <Extension()> Public Function MassageErrorTypeNames(p As SymbolDisplayPart, Optional replacement As String = Nothing) As SymbolDisplayPart If p.Kind = SymbolDisplayPartKind.ErrorTypeName Then Dim text = p.ToString() If text = String.Empty Then Return If(replacement = Nothing, New SymbolDisplayPart(SymbolDisplayPartKind.Keyword, Nothing, "Object"), New SymbolDisplayPart(SymbolDisplayPartKind.Text, Nothing, replacement)) End If If SyntaxFacts.GetKeywordKind(text) <> SyntaxKind.None Then Return New SymbolDisplayPart(SymbolDisplayPartKind.ErrorTypeName, Nothing, String.Format("[{0}]", text)) End If End If Return p End Function End Module End Namespace