LanguageServices.GetService<TLanguageService> 方法

定义

获取由服务类型标识的主机提供的特定于语言的服务。 如果主机未提供服务,此方法将返回 null。

public TLanguageService? GetService<TLanguageService> () where TLanguageService : Microsoft.CodeAnalysis.Host.ILanguageService;
member this.GetService : unit -> 'LanguageService (requires 'LanguageService :> Microsoft.CodeAnalysis.Host.ILanguageService)
Public Function GetService(Of TLanguageService As ILanguageService) () As TLanguageService

类型参数

TLanguageService

返回

TLanguageService

适用于