/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Compilers/VisualBasic/Portable/Symbols/EmbeddedSymbols/EmbeddedSymbolExtensions.vb
40 строк
2 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.Runtime.CompilerServices Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic.Symbols Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols Friend Module EmbeddedSymbolExtensions ''' <summary> ''' True if the syntax tree is an embedded syntax tree ''' </summary> <Extension()> Public Function IsEmbeddedSyntaxTree(tree As SyntaxTree) As Boolean Return EmbeddedSymbolManager.GetEmbeddedKind(tree) <> EmbeddedSymbolKind.None End Function <Extension()> Public Function GetEmbeddedKind(tree As SyntaxTree) As EmbeddedSymbolKind Return EmbeddedSymbolManager.GetEmbeddedKind(tree) End Function <Extension()> Public Function IsEmbeddedOrMyTemplateTree(tree As SyntaxTree) As Boolean Dim vbTree = TryCast(tree, VisualBasicSyntaxTree) Return vbTree IsNot Nothing AndAlso vbTree.IsMyTemplate OrElse vbTree.IsEmbeddedSyntaxTree End Function <Extension()> Public Function IsEmbeddedOrMyTemplateLocation(location As Location) As Boolean Return TypeOf location Is EmbeddedTreeLocation OrElse TypeOf location Is MyTemplateLocation End Function End Module End Namespace