/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/VisualStudio/CSharp/Impl/LanguageService/CSharpCreateServicesOnTextViewConnection.cs
45 строк
2 KB
Jason Malinowski
Remove use of DisposalToken if we can just call Dispose() instead
04 авг 2026, 23:51
04 авг 2026, 23:51
5ab65fc
Код
Авторство
О чём код?
// 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. using System; using System.ComponentModel.Composition; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Completion; using Microsoft.CodeAnalysis.Completion.Providers; using Microsoft.CodeAnalysis.Editor; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Options; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Shared.TestHooks; using Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Utilities; namespace Microsoft.VisualStudio.LanguageServices.CSharp.Snippets; [Export(typeof(IWpfTextViewConnectionListener))] [ContentType(ContentTypeNames.CSharpContentType)] [TextViewRole(PredefinedTextViewRoles.Interactive)] [method: ImportingConstructor] [method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] internal sealed class CSharpCreateServicesOnTextViewConnection( VisualStudioWorkspace workspace, IGlobalOptionService globalOptions, IAsynchronousOperationListenerProvider listenerProvider) : AbstractCreateServicesOnTextViewConnection( workspace, globalOptions, listenerProvider, LanguageNames.CSharp) { protected override async Task InitializeServiceForProjectWithOpenedDocumentAsync(Project project) { // Only pre-populate cache if import completion is enabled if (GlobalOptions.GetOption(CompletionOptionsStorage.ShowItemsFromUnimportedNamespaces, LanguageNames.CSharp) != true) return; var service = project.GetRequiredLanguageService<ITypeImportCompletionService>(); service.QueueCacheWarmUpTask(project); await ExtensionMemberImportCompletionHelper.WarmUpCacheAsync(project, CancellationToken.None).ConfigureAwait(false); } }