/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/EditorFeatures/Core/NavigableSymbols/NavigableSymbolService.cs
39 строк
2 KB
Joey Robichaud
Reapply "Move to .NET 10 Preview 5 (#78906)"
08 июл 2025, 07:36
08 июл 2025, 07:36
1e5af11
Код
Авторство
О чём код?
// 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.ComponentModel.Composition; using System.Diagnostics.CodeAnalysis; using Microsoft.CodeAnalysis.Editor.Shared.Extensions; using Microsoft.CodeAnalysis.Editor.Shared.Utilities; using Microsoft.CodeAnalysis.Shared.TestHooks; using Microsoft.VisualStudio.Language.Intellisense; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Utilities; namespace Microsoft.CodeAnalysis.Editor.NavigableSymbols; [Export(typeof(INavigableSymbolSourceProvider))] [Name(nameof(NavigableSymbolService))] [ContentType(ContentTypeNames.RoslynContentType)] internal sealed partial class NavigableSymbolService : INavigableSymbolSourceProvider { private static readonly object s_key = new(); private readonly IThreadingContext _threadingContext; private readonly IAsynchronousOperationListener _listener; [ImportingConstructor] [SuppressMessage("RoslynDiagnosticsReliability", "RS0033:Importing constructor should be [Obsolete]", Justification = "Used in test code: https://github.com/dotnet/roslyn/issues/42814")] public NavigableSymbolService( IThreadingContext threadingContext, IAsynchronousOperationListenerProvider listenerProvider) { _threadingContext = threadingContext; _listener = listenerProvider.GetListener(FeatureAttribute.NavigableSymbols); } public INavigableSymbolSource TryCreateNavigableSymbolSource(ITextView textView, ITextBuffer buffer) => textView.GetOrCreatePerSubjectBufferProperty(buffer, s_key, (view, _) => new NavigableSymbolSource(this, view)); }