/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/VisualStudio/Core/Def/NavigateTo/RoslynSearchResultPreviewPanel.cs
43 строки
2 KB
Cyrus Najmabadi
Only features
30 дек 2025, 06:45
30 дек 2025, 06:45
4a47b43
Код
Авторство
О чём код?
// 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.Threading.Tasks; using Microsoft.VisualStudio.Core.Imaging; using Microsoft.VisualStudio.Search.Data; using Microsoft.VisualStudio.Search.UI.PreviewPanel.Models; using Microsoft.VisualStudio.Text; namespace Microsoft.CodeAnalysis.NavigateTo; internal sealed partial class RoslynSearchItemsSourceProvider { /// <summary> /// Roslyn preview for our nav-to result. We just provide a code-editor with the caret positioned in the /// correct location. /// </summary> private sealed class RoslynSearchResultPreviewPanel : SearchResultPreviewPanelBase { public override UIBaseModel UserInterface { get; } public RoslynSearchResultPreviewPanel( RoslynSearchItemsSourceProvider provider, Uri uri, Guid projectGuid, Span span, string title, ImageId icon) : base(title, icon) { Contract.ThrowIfFalse(uri.IsAbsoluteUri, $"{nameof(TextDocumentLocation)} assumes the URI is an absolute URI and invokes {nameof(Uri.LocalPath)}."); UserInterface = new CodeEditorModel( nameof(RoslynSearchResultPreviewPanel), new VisualStudio.Threading.AsyncLazy<TextDocumentLocation>(() => Task.FromResult(new TextDocumentLocation(uri, projectGuid, span)), provider._threadingContext.JoinableTaskFactory), isEditable: true); } } }