提交 b39b95e6 编写于 作者: J JieCarolHu

rename QuickInfoCommandHandlerAndSourceProvider to QuickInfoSourceProvider

上级 99049162
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.QuickInfo;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using VSCommanding = Microsoft.VisualStudio.Commanding;
......@@ -30,18 +31,18 @@ internal abstract class AbstractIntelliSenseCommandHandler :
{
private readonly CompletionCommandHandler _completionCommandHandler;
private readonly SignatureHelpCommandHandler _signatureHelpCommandHandler;
private readonly QuickInfoCommandHandlerAndSourceProvider _quickInfoCommandHandler;
private readonly QuickInfoSourceProvider _quickInfoSourceProvider;
public string DisplayName => EditorFeaturesResources.IntelliSense;
protected AbstractIntelliSenseCommandHandler(
CompletionCommandHandler completionCommandHandler,
SignatureHelpCommandHandler signatureHelpCommandHandler,
QuickInfoCommandHandlerAndSourceProvider quickInfoCommandHandler)
QuickInfoSourceProvider quickInfoSourceProvider)
{
_completionCommandHandler = completionCommandHandler;
_signatureHelpCommandHandler = signatureHelpCommandHandler;
_quickInfoCommandHandler = quickInfoCommandHandler;
_quickInfoSourceProvider = quickInfoSourceProvider;
}
public VSCommanding.CommandState GetCommandState(EscapeKeyCommandArgs args, Func<VSCommanding.CommandState> nextHandler)
......@@ -63,7 +64,7 @@ public void ExecuteCommand(EscapeKeyCommandArgs args, Action nextHandler, Comman
{
if ((_completionCommandHandler != null && _completionCommandHandler.TryHandleEscapeKey(args)) ||
(_signatureHelpCommandHandler != null && _signatureHelpCommandHandler.TryHandleEscapeKey(args)) ||
(_quickInfoCommandHandler != null && _quickInfoCommandHandler.TryHandleEscapeKey(args)))
(_quickInfoSourceProvider != null && _quickInfoSourceProvider.TryHandleEscapeKey(args)))
{
return;
}
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.QuickInfo;
using Microsoft.VisualStudio.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
......@@ -15,10 +16,10 @@ internal sealed class IntelliSenseCommandHandler : AbstractIntelliSenseCommandHa
public IntelliSenseCommandHandler(
CompletionCommandHandler completionCommandHandler,
SignatureHelpCommandHandler signatureHelpCommandHandler,
QuickInfoCommandHandlerAndSourceProvider quickInfoCommandHandler)
QuickInfoSourceProvider quickInfoSourceProvider)
: base(completionCommandHandler,
signatureHelpCommandHandler,
quickInfoCommandHandler)
quickInfoSourceProvider)
{
}
}
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.CodeAnalysis.Editor
{
internal static class PredefinedQuickInfoSourceProviderNames
{
public const string EventHookup = "Event Hookup QuickInfo Source";
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.QuickInfo;
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.CodeAnalysis.Editor.Shared.Options;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.Shared.TestHooks;
using Microsoft.CodeAnalysis.Shared.Utilities;
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.VisualStudio.Utilities;
namespace Microsoft.CodeAnalysis.Editor.CommandHandlers
namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.QuickInfo
{
[Export]
[Order(After = PredefinedQuickInfoPresenterNames.RoslynQuickInfoPresenter)]
[Export]
[ContentType(ContentTypeNames.RoslynContentType)]
[Export(typeof(IAsyncQuickInfoSourceProvider))]
[Name("RoslynQuickInfoProvider")]
internal partial class QuickInfoCommandHandlerAndSourceProvider :
internal partial class QuickInfoSourceProvider :
ForegroundThreadAffinitizedObject,
IAsyncQuickInfoSourceProvider
{
......
......@@ -6,29 +6,29 @@
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
namespace Microsoft.CodeAnalysis.Editor.CommandHandlers
namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.QuickInfo
{
internal partial class QuickInfoCommandHandlerAndSourceProvider
internal partial class QuickInfoSourceProvider
{
private class QuickInfoSource : IAsyncQuickInfoSource
{
private readonly QuickInfoCommandHandlerAndSourceProvider _commandHandler;
private readonly QuickInfoSourceProvider _quickInfoSourceProvider;
private readonly ITextBuffer _subjectBuffer;
public QuickInfoSource(QuickInfoCommandHandlerAndSourceProvider commandHandler, ITextBuffer subjectBuffer)
public QuickInfoSource(QuickInfoSourceProvider quickInfoSourceProvider, ITextBuffer subjectBuffer)
{
_commandHandler = commandHandler;
_quickInfoSourceProvider = quickInfoSourceProvider;
_subjectBuffer = subjectBuffer;
}
public Task<QuickInfoItem> GetQuickInfoItemAsync(IAsyncQuickInfoSession session, CancellationToken cancellationToken)
{
var triggerPoint = session.GetTriggerPoint(_subjectBuffer.CurrentSnapshot);
if (triggerPoint != null && triggerPoint.HasValue)
if (triggerPoint.HasValue)
{
var textView = session.TextView;
var args = new InvokeQuickInfoCommandArgs(textView, _subjectBuffer);
if (_commandHandler.TryGetController(args, out var controller))
if (_quickInfoSourceProvider.TryGetController(args, out var controller))
{
return controller.GetQuickInfoItemAsync(triggerPoint.Value, cancellationToken);
}
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.QuickInfo;
using Microsoft.VisualStudio.InteractiveWindow.Commands;
using Microsoft.VisualStudio.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
......@@ -16,10 +17,10 @@ internal sealed class InteractiveIntelliSenseCommandHandler : AbstractIntelliSen
public InteractiveIntelliSenseCommandHandler(
CompletionCommandHandler completionCommandHandler,
SignatureHelpCommandHandler signatureHelpCommandHandler,
QuickInfoCommandHandlerAndSourceProvider quickInfoCommandHandler)
QuickInfoSourceProvider quickInfoSourceProvider)
: base(completionCommandHandler,
signatureHelpCommandHandler,
quickInfoCommandHandler)
quickInfoSourceProvider)
{
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册