提交 aee5ac40 编写于 作者: R Ravi Chande

Stop handling quickinfo-related commands

To address accessibility issues, the editor has added its own handler for the INvokeQuickInfo command. We therefore need to remove Roslyn's handling of the same command.
上级 0bc7d6bc
......@@ -39,7 +39,7 @@ public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> qui
var args = new InvokeQuickInfoCommandArgs(textView, _subjectBuffer);
if (_commandHandler.TryGetController(args, out var controller))
{
controller.InvokeQuickInfo(position.Value, trackMouse: true, augmentSession: session);
controller.InvokeQuickInfo(position.Value, trackMouse: session.TrackMouse, augmentSession: session);
}
}
}
......
......@@ -19,39 +19,35 @@
namespace Microsoft.CodeAnalysis.Editor.CommandHandlers
{
[Export]
[Export(typeof(IQuickInfoSourceProvider))]
[Order(After = PredefinedQuickInfoPresenterNames.RoslynQuickInfoPresenter)]
[ExportCommandHandler(PredefinedCommandHandlerNames.QuickInfo, ContentTypeNames.RoslynContentType)]
[ContentType(ContentTypeNames.RoslynContentType)]
[Export(typeof(IQuickInfoSourceProvider))]
[Name("RoslynQuickInfoProvider")]
internal partial class QuickInfoCommandHandlerAndSourceProvider :
ForegroundThreadAffinitizedObject,
ICommandHandler<InvokeQuickInfoCommandArgs>,
IQuickInfoSourceProvider
{
private readonly IInlineRenameService _inlineRenameService;
private readonly IIntelliSensePresenter<IQuickInfoPresenterSession, IQuickInfoSession> _presenter;
private readonly IEnumerable<Lazy<IAsynchronousOperationListener, FeatureMetadata>> _asyncListeners;
private readonly IList<Lazy<IQuickInfoProvider, OrderableLanguageMetadata>> _providers;
[ImportingConstructor]
public QuickInfoCommandHandlerAndSourceProvider(
IInlineRenameService inlineRenameService,
[ImportMany] IEnumerable<Lazy<IQuickInfoProvider, OrderableLanguageMetadata>> providers,
[ImportMany] IEnumerable<Lazy<IAsynchronousOperationListener, FeatureMetadata>> asyncListeners,
[ImportMany] IEnumerable<Lazy<IIntelliSensePresenter<IQuickInfoPresenterSession, IQuickInfoSession>, OrderableMetadata>> presenters)
: this(inlineRenameService,
ExtensionOrderer.Order(presenters).Select(lazy => lazy.Value).FirstOrDefault(),
: this(ExtensionOrderer.Order(presenters).Select(lazy => lazy.Value).FirstOrDefault(),
providers, asyncListeners)
{
}
// For testing purposes.
public QuickInfoCommandHandlerAndSourceProvider(
IInlineRenameService inlineRenameService,
IIntelliSensePresenter<IQuickInfoPresenterSession, IQuickInfoSession> presenter,
[ImportMany] IEnumerable<Lazy<IQuickInfoProvider, OrderableLanguageMetadata>> providers,
[ImportMany] IEnumerable<Lazy<IAsynchronousOperationListener, FeatureMetadata>> asyncListeners)
{
_inlineRenameService = inlineRenameService;
_providers = ExtensionOrderer.Order(providers);
_asyncListeners = asyncListeners;
_presenter = presenter;
......
......@@ -459,11 +459,6 @@ protected virtual int ExecuteVisualStudio2000(ref Guid pguidCmdGroup, uint comma
ExecuteParameterInfo(subjectBuffer, contentType, executeNextCommandTarget);
break;
case VSConstants.VSStd2KCmdID.QUICKINFO:
GCManager.UseLowLatencyModeForProcessingUserInput();
ExecuteQuickInfo(subjectBuffer, contentType, executeNextCommandTarget);
break;
case VSConstants.VSStd2KCmdID.RENAME:
GCManager.UseLowLatencyModeForProcessingUserInput();
ExecuteRename(subjectBuffer, contentType, executeNextCommandTarget);
......@@ -646,13 +641,6 @@ protected void ExecuteRename(ITextBuffer subjectBuffer, IContentType contentType
lastHandler: executeNextCommandTarget);
}
protected void ExecuteQuickInfo(ITextBuffer subjectBuffer, IContentType contentType, Action executeNextCommandTarget)
{
CurrentHandlers.Execute(contentType,
args: new InvokeQuickInfoCommandArgs(ConvertTextView(), subjectBuffer),
lastHandler: executeNextCommandTarget);
}
protected void ExecuteParameterInfo(ITextBuffer subjectBuffer, IContentType contentType, Action executeNextCommandTarget)
{
CurrentHandlers.Execute(contentType,
......
......@@ -165,9 +165,6 @@ private int QueryVisualStudio2000Status(ref Guid pguidCmdGroup, uint commandCoun
case VSConstants.VSStd2KCmdID.PARAMINFO:
return QueryParameterInfoStatus(prgCmds);
case VSConstants.VSStd2KCmdID.QUICKINFO:
return QueryQuickInfoStatus(prgCmds);
case VSConstants.VSStd2KCmdID.RENAME:
return QueryRenameStatus(ref pguidCmdGroup, commandCount, prgCmds, commandText);
......@@ -344,12 +341,6 @@ private int QueryRenameStatus(ref Guid pguidCmdGroup, uint commandCount, OLECMD[
ref pguidCmdGroup, commandCount, prgCmds, commandText);
}
private int QueryQuickInfoStatus(OLECMD[] prgCmds)
{
prgCmds[0].cmdf = (uint)(OLECMDF.OLECMDF_ENABLED | OLECMDF.OLECMDF_SUPPORTED);
return VSConstants.S_OK;
}
private int QueryParameterInfoStatus(OLECMD[] prgCmds)
{
prgCmds[0].cmdf = (uint)(OLECMDF.OLECMDF_ENABLED | OLECMDF.OLECMDF_SUPPORTED);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册