/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/VisualStudio/CSharp/Impl/SemanticSearch/OpenSemanticSearchWindowCommand.cs
27 строк
1 KB
Tomáš Matoušek
Use ActivationConstraint.FeatureFlag API to control when Semantic Search is enabled (#77133)
30 апр 2025, 01:00
Не верифицирован
30 апр 2025, 01:00
e51a3c6
Код
Авторство
О чём код?
// 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.Threading; using System.Threading.Tasks; using Microsoft.VisualStudio.Extensibility; using Microsoft.VisualStudio.Extensibility.Commands; namespace Microsoft.VisualStudio.LanguageServices.CSharp; /// <summary> /// Implements View/Other Windows/Semantic Search command. /// </summary> [VisualStudioContribution] internal sealed class OpenSemanticSearchWindowCommand : Command { public override CommandConfiguration CommandConfiguration => new("%CSharpLanguageServiceExtension.OpenSemanticSearchWindow.DisplayName%") { Icon = new(ImageMoniker.KnownValues.FindSymbol, IconSettings.IconAndText), Placements = [CommandPlacement.KnownPlacements.ViewOtherWindowsMenu.WithPriority(0x8010)], VisibleWhen = ActivationConstraint.FeatureFlag("Roslyn.SemanticSearchEnabled") }; public override Task ExecuteCommandAsync(IClientContext context, CancellationToken cancellationToken) => Extensibility.Shell().ShowToolWindowAsync<SemanticSearchToolWindow>(activate: true, cancellationToken); }