Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of new editor completion API #25770

Closed
wants to merge 96 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
c2ae761
Implementation and cleanup of completion
dpoeschl Jan 29, 2018
97657fa
NoWarn for some reason
dpoeschl Mar 29, 2018
35196e0
Update Editor NuGet references
dpoeschl Mar 29, 2018
5d4652a
Actually update editor nugets
dpoeschl Mar 29, 2018
983d67b
TextInternal version
dpoeschl Mar 30, 2018
555d529
Use a usable textinternal
dpoeschl Mar 30, 2018
abbb9ea
New NuGets
dpoeschl Apr 6, 2018
3c66d37
Newer NuGets
dpoeschl Apr 9, 2018
cadd494
Disable completion during Inline Rename
dpoeschl Apr 9, 2018
9410bc8
Fix signing of swix project output
jaredpar Mar 30, 2018
16919a4
Update NuGets
dpoeschl May 1, 2018
b5d045b
New initial selection handling WIP
dpoeschl May 1, 2018
17b5144
Newer NuGets
dpoeschl May 2, 2018
33bff91
Race condition avoided...
dpoeschl May 3, 2018
943cced
Fixup Packages
dpoeschl May 10, 2018
d0095d8
It builds again
dpoeschl May 10, 2018
8b9ac6b
Update NuGets and build
dpoeschl May 14, 2018
03d858a
switching things up
dpoeschl May 14, 2018
625a51b
Revert "switching things up"
dpoeschl May 14, 2018
d9d3a8b
Make some tests start passing.
dpoeschl May 15, 2018
0cb2083
167/246 C# tests passing
dpoeschl May 18, 2018
ef2edb4
Update packages
dpoeschl May 18, 2018
38c61d8
Adapt to NuGets
dpoeschl May 18, 2018
373839f
New CommandHandler name
dpoeschl May 21, 2018
a5503f9
Fix some tests
dpoeschl May 21, 2018
5310bd4
Hack that probably doesn't work
dpoeschl May 21, 2018
a1e8737
Update nugets
dpoeschl May 23, 2018
233282b
IVT does custom commit
dpoeschl May 23, 2018
a5d50ac
Stop using IsUnavailable
dpoeschl May 23, 2018
4625d7b
Update Nugets
dpoeschl May 24, 2018
941f835
Hard select on backspace correctly
dpoeschl May 24, 2018
033efa2
Implementation and cleanup of completion
dpoeschl Jan 29, 2018
efe328c
NoWarn for some reason
dpoeschl Mar 29, 2018
740b007
Actually update editor nugets
dpoeschl Mar 29, 2018
bf65e20
New NuGets
dpoeschl Apr 6, 2018
77332f4
Newer NuGets
dpoeschl Apr 9, 2018
c584822
Disable completion during Inline Rename
dpoeschl Apr 9, 2018
b5c1b8e
New initial selection handling WIP
dpoeschl May 1, 2018
9bf209d
Newer NuGets
dpoeschl May 2, 2018
15d0d10
Race condition avoided...
dpoeschl May 3, 2018
05be2af
It builds again
dpoeschl May 10, 2018
eea54d2
Update NuGets and build
dpoeschl May 14, 2018
dda77cb
switching things up
dpoeschl May 14, 2018
d2384cc
Revert "switching things up"
dpoeschl May 14, 2018
e3f9f6b
Make some tests start passing.
dpoeschl May 15, 2018
8f72b94
167/246 C# tests passing
dpoeschl May 18, 2018
44a9241
Update packages
dpoeschl May 18, 2018
5f8ebfa
Adapt to NuGets
dpoeschl May 18, 2018
df121e5
New CommandHandler name
dpoeschl May 21, 2018
23f1ab8
Fix some tests
dpoeschl May 21, 2018
166c05d
Hack that probably doesn't work
dpoeschl May 21, 2018
8fdd2e0
Update nugets
dpoeschl May 23, 2018
a51a339
IVT does custom commit
dpoeschl May 23, 2018
27868d2
Stop using IsUnavailable
dpoeschl May 23, 2018
4839905
Update Nugets
dpoeschl May 24, 2018
8565d6c
Hard select on backspace correctly
dpoeschl May 24, 2018
400d07e
resolving merge conflicts
ivanbasov May 31, 2018
ae7e48f
resolving merge conflict
ivanbasov May 31, 2018
472210d
Revert changes to AbstractCompletionCommandHandler
dpoeschl May 25, 2018
18c0183
using feature flag to avoid calling old completion service
ivanbasov Jun 1, 2018
d904e65
restoring tests for the old completion service
ivanbasov Jun 1, 2018
b302fae
Undo NuGet.Config changes
dpoeschl May 25, 2018
bb864ce
Inherit NoWarns properly
dpoeschl May 25, 2018
f956abe
Reenable InlineRenameService
dpoeschl May 25, 2018
635f1f1
Comment the InlineRenameSession disabling of completion
dpoeschl May 25, 2018
8a77f1d
seal CompletionCommitManager
dpoeschl May 25, 2018
4661e03
Cancellation in the CompletionItemSource
dpoeschl May 31, 2018
e28cb0e
Comment in the CompletionCommitManager
dpoeschl May 31, 2018
42637eb
Updates to the CompletionItemSource
dpoeschl May 31, 2018
7e1095f
Rename Service to ItemManager
dpoeschl May 31, 2018
065cd63
ItemManager file names
dpoeschl May 31, 2018
e4b0f39
ItemManager updates
dpoeschl May 31, 2018
3491b05
More Review Feedback
dpoeschl Jun 4, 2018
26634e2
Update TODO
dpoeschl Jun 4, 2018
2c7d8f9
Link todos to bugs
dpoeschl Jun 4, 2018
aed4d78
Use TextView property instead of field in tests
dpoeschl Jun 4, 2018
ffdd4fe
Remove another trace of TestWaitIndicator
dpoeschl Jun 4, 2018
33facbb
Begin to explain IFeaturesCustomCommitCompletionProvider
dpoeschl Jun 4, 2018
a729eb2
More TODO links
dpoeschl Jun 4, 2018
626e95d
Need to export the TestWaitIndicator
dpoeschl Jun 4, 2018
c7c2318
Skip failing tests
dpoeschl Jun 4, 2018
02be360
VB Test Updates
dpoeschl Jun 5, 2018
89802a1
fixing broken oldCompletion unit tests
ivanbasov Jun 5, 2018
9d37ced
Skip the rest of the failing VB tests
dpoeschl Jun 5, 2018
17aaa26
move intellisense tests
ivanbasov Jun 5, 2018
e924113
expect to fix 41 of 54 failures
ivanbasov Jun 6, 2018
8ec341e
correct fix for generatetype tests
ivanbasov Jun 6, 2018
85db98a
fixing one more test
ivanbasov Jun 7, 2018
ffc0763
more tests fixed
ivanbasov Jun 7, 2018
935eced
Update NuGets
dpoeschl Jun 6, 2018
4c734f1
Fix a couple snippet tests
dpoeschl Jun 7, 2018
ca903bf
fixed flaky tests
ivanbasov Jun 7, 2018
ea29b6d
Merge branch 'master-vs-deps' into features/AsyncCompletion
ivanbasov Jun 7, 2018
b2d4d95
resolving split string literal tests
ivanbasov Jun 8, 2018
b56c3d8
Disable VB tests for documented reasons
dpoeschl Jun 10, 2018
4599877
fix the KnownImageIds.LocalVariable which was missed in the previous PR
JieCarolHu Apr 5, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions build/Targets/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@
<MicrosoftVisualStudioCodeAnalysisSdkUIVersion>15.0.26730-alpha</MicrosoftVisualStudioCodeAnalysisSdkUIVersion>
<MicrosoftVisualStudioComponentModelHostVersion>15.0.26730-alpha</MicrosoftVisualStudioComponentModelHostVersion>
<MicrosoftVisualStudioCompositionVersion>15.5.23</MicrosoftVisualStudioCompositionVersion>
<MicrosoftVisualStudioCoreUtilityVersion>15.8.238-preview</MicrosoftVisualStudioCoreUtilityVersion>
<MicrosoftVisualStudioDebuggerEngineVersion>15.0.27309-vsucorediag</MicrosoftVisualStudioDebuggerEngineVersion>
<MicrosoftVisualStudioDebuggerMetadataVersion>15.0.27309-vsucorediag</MicrosoftVisualStudioDebuggerMetadataVersion>
<MicrosoftVisualStudioDebuggerUIInterfacesVersion>15.0.27309-vsucorediag</MicrosoftVisualStudioDebuggerUIInterfacesVersion>
<MicrosoftVisualStudioCoreUtilityVersion>15.8.386-preview-g596ac9ac8e</MicrosoftVisualStudioCoreUtilityVersion>
<MicrosoftVisualStudioDebuggerInterop100Version>10.0.30319</MicrosoftVisualStudioDebuggerInterop100Version>
<MicrosoftVisualStudioDesignerInterfacesVersion>1.1.4322</MicrosoftVisualStudioDesignerInterfacesVersion>
<MicrosoftVisualStudioDiagnosticsPerformanceProviderVersion>15.0.26730-alpha</MicrosoftVisualStudioDiagnosticsPerformanceProviderVersion>
Expand All @@ -91,11 +91,12 @@
<MicrosoftVisualStudioImagingInterop140DesignTimeVersion>15.0.25726-Preview5</MicrosoftVisualStudioImagingInterop140DesignTimeVersion>
<MicrosoftVisualStudioInteractiveWindowVersion>2.0.0-rc3-61304-01</MicrosoftVisualStudioInteractiveWindowVersion>
<MicrosoftVisualStudioLanguageCallHierarchyVersion>15.3.1710.203</MicrosoftVisualStudioLanguageCallHierarchyVersion>
<MicrosoftVisualStudioLanguageIntellisenseVersion>15.8.238-preview</MicrosoftVisualStudioLanguageIntellisenseVersion>
<MicrosoftVisualStudioLanguageNavigateToInterfacesVersion>15.8.238-preview</MicrosoftVisualStudioLanguageNavigateToInterfacesVersion>
<MicrosoftVisualStudioLanguageStandardClassificationVersion>15.8.238-preview</MicrosoftVisualStudioLanguageStandardClassificationVersion>
<MicrosoftVisualStudioLanguageVersion>15.8.386-preview-g596ac9ac8e</MicrosoftVisualStudioLanguageVersion>
<MicrosoftVisualStudioLanguageIntellisenseVersion>15.8.386-preview-g596ac9ac8e</MicrosoftVisualStudioLanguageIntellisenseVersion>
<MicrosoftVisualStudioLanguageNavigateToInterfacesVersion>15.7.153-preview-g7d0635149a</MicrosoftVisualStudioLanguageNavigateToInterfacesVersion>
<MicrosoftVisualStudioLanguageStandardClassificationVersion>15.8.386-preview-g596ac9ac8e</MicrosoftVisualStudioLanguageStandardClassificationVersion>
<MicrosoftVisualStudioOLEInteropVersion>7.10.6070</MicrosoftVisualStudioOLEInteropVersion>
<MicrosoftVisualStudioPlatformVSEditorVersion>15.8.238-preview</MicrosoftVisualStudioPlatformVSEditorVersion>
<MicrosoftVisualStudioPlatformVSEditorVersion>15.8.386-preview-g596ac9ac8e</MicrosoftVisualStudioPlatformVSEditorVersion>
<MicrosoftVisualStudioProgressionCodeSchemaVersion>15.0.26730-alpha</MicrosoftVisualStudioProgressionCodeSchemaVersion>
<MicrosoftVisualStudioProgressionCommonVersion>15.0.26730-alpha</MicrosoftVisualStudioProgressionCommonVersion>
<MicrosoftVisualStudioProgressionInterfacesVersion>15.0.26730-alpha</MicrosoftVisualStudioProgressionInterfacesVersion>
Expand All @@ -122,11 +123,11 @@
<MicrosoftVisualStudioShellInterop90Version>9.0.30729</MicrosoftVisualStudioShellInterop90Version>
<MicrosoftVisualStudioTelemetryVersion>15.0.26730-alpha</MicrosoftVisualStudioTelemetryVersion>
<MicrosoftVisualStudioTemplateWizardInterfaceVersion>8.0.0.0-alpha</MicrosoftVisualStudioTemplateWizardInterfaceVersion>
<MicrosoftVisualStudioTextDataVersion>15.8.238-preview</MicrosoftVisualStudioTextDataVersion>
<MicrosoftVisualStudioTextInternalVersion>15.8.238-preview</MicrosoftVisualStudioTextInternalVersion>
<MicrosoftVisualStudioTextLogicVersion>15.8.238-preview</MicrosoftVisualStudioTextLogicVersion>
<MicrosoftVisualStudioTextUIVersion>15.8.238-preview</MicrosoftVisualStudioTextUIVersion>
<MicrosoftVisualStudioTextUIWpfVersion>15.8.238-preview</MicrosoftVisualStudioTextUIWpfVersion>
<MicrosoftVisualStudioTextDataVersion>15.8.386-preview-g596ac9ac8e</MicrosoftVisualStudioTextDataVersion>
<MicrosoftVisualStudioTextInternalVersion>15.8.386-preview-g596ac9ac8e</MicrosoftVisualStudioTextInternalVersion>
<MicrosoftVisualStudioTextLogicVersion>15.8.386-preview-g596ac9ac8e</MicrosoftVisualStudioTextLogicVersion>
<MicrosoftVisualStudioTextUIVersion>15.8.386-preview-g596ac9ac8e</MicrosoftVisualStudioTextUIVersion>
<MicrosoftVisualStudioTextUIWpfVersion>15.8.386-preview-g596ac9ac8e</MicrosoftVisualStudioTextUIWpfVersion>
<MicrosoftVisualStudioTextManagerInteropVersion>7.10.6070</MicrosoftVisualStudioTextManagerInteropVersion>
<MicrosoftVisualStudioTextManagerInterop100Version>10.0.30319</MicrosoftVisualStudioTextManagerInterop100Version>
<MicrosoftVisualStudioTextManagerInterop120Version>12.0.30110</MicrosoftVisualStudioTextManagerInterop120Version>
Expand Down
3 changes: 2 additions & 1 deletion build/Targets/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
<!-- The release moniker for our packages. Developers should use "dev" and official builds pick the branch
moniker listed below -->
<RoslynNuGetMoniker Condition="'$(RoslynNuGetMoniker)' == ''">dev</RoslynNuGetMoniker>
<RoslynNuGetMoniker Condition="'$(OfficialBuild)' == 'true'">beta7</RoslynNuGetMoniker>

<RoslynNuGetMoniker Condition="'$(OfficialBuild)' == 'true'">asynccompletion</RoslynNuGetMoniker>

<!-- This is the base of the NuGet versioning for prerelease packages -->
<NuGetPreReleaseVersion>$(RoslynFileVersionBase)-$(RoslynNuGetMoniker)</NuGetPreReleaseVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using Roslyn.Utilities;
using RoslynCompletion = Microsoft.CodeAnalysis.Completion;

namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation
{
Expand Down Expand Up @@ -72,9 +73,9 @@ public CompletionPresenterSession(

public void PresentItems(
ITrackingSpan triggerSpan,
IList<CompletionItem> completionItems,
CompletionItem selectedItem,
CompletionItem suggestionModeItem,
IList<RoslynCompletion.CompletionItem> completionItems,
RoslynCompletion.CompletionItem selectedItem,
RoslynCompletion.CompletionItem suggestionModeItem,
bool suggestionMode,
bool isSoftSelected,
ImmutableArray<CompletionItemFilter> completionItemFilters,
Expand Down Expand Up @@ -142,7 +143,7 @@ private void OnEditorSessionDismissed()
this.Dismissed?.Invoke(this, new EventArgs());
}

internal void OnCompletionItemCommitted(CompletionItem completionItem)
internal void OnCompletionItemCommitted(RoslynCompletion.CompletionItem completionItem)
{
AssertIsForeground();
this.ItemCommitted?.Invoke(this, new CompletionItemEventArgs(completionItem));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
using Microsoft.VisualStudio.Imaging.Interop;
using Microsoft.VisualStudio.Language.Intellisense;
using Roslyn.Utilities;
using CompletionItem = Microsoft.CodeAnalysis.Completion.CompletionItem;
using RoslynCompletion = Microsoft.CodeAnalysis.Completion;

namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation
{
internal sealed class CustomCommitCompletion : Completion3, ICustomCommit
{
private const string s_glyphCompletionWarning = "GlyphCompletionWarning";
private readonly CompletionPresenterSession _completionPresenterSession;
internal readonly CompletionItem CompletionItem;
internal readonly RoslynCompletion.CompletionItem CompletionItem;
private readonly ImageMoniker _imageMoniker;

public CustomCommitCompletion(
CompletionPresenterSession completionPresenterSession,
CompletionItem completionItem)
RoslynCompletion.CompletionItem completionItem)
{
// PERF: Note that the base class contains a constructor taking the displayText string
// but we're intentionally NOT using that here because it allocates a private CompletionState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using RoslynCompletion = Microsoft.CodeAnalysis.Completion;
using VSCompletion = Microsoft.VisualStudio.Language.Intellisense.Completion;
using CompletionItem = Microsoft.CodeAnalysis.Completion.CompletionItem;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can be removed since you're using RoslynCompletion.CompletionItem below. Also remove this using from other files


Expand All @@ -31,8 +32,8 @@ internal class RoslynCompletionSet : CompletionSet2
protected readonly CompletionPresenterSession CompletionPresenterSession;
private CompletionHelper _completionHelper;

protected Dictionary<CompletionItem, VSCompletion> CompletionItemMap;
protected CompletionItem SuggestionModeItem;
protected Dictionary<RoslynCompletion.CompletionItem, VSCompletion> CompletionItemMap;
protected RoslynCompletion.CompletionItem SuggestionModeItem;

private readonly Dictionary<string, string> _displayTextToBoldingTextMap = new Dictionary<string, string>();

Expand Down Expand Up @@ -87,9 +88,9 @@ public override void Recalculate()
}

public void SetCompletionItems(
IList<CompletionItem> completionItems,
CompletionItem selectedItem,
CompletionItem suggestionModeItem,
IList<RoslynCompletion.CompletionItem> completionItems,
RoslynCompletion.CompletionItem selectedItem,
RoslynCompletion.CompletionItem suggestionModeItem,
bool suggestionMode,
bool isSoftSelected,
ImmutableArray<CompletionItemFilter> completionItemFilters,
Expand All @@ -106,7 +107,7 @@ public void SetCompletionItems(
}

// Initialize the completion map to a reasonable default initial size (+1 for the builder)
CompletionItemMap = CompletionItemMap ?? new Dictionary<CompletionItem, VSCompletion>(completionItems.Count + 1);
CompletionItemMap = CompletionItemMap ?? new Dictionary<RoslynCompletion.CompletionItem, VSCompletion>(completionItems.Count + 1);
FilterText = filterText;
SuggestionModeItem = suggestionModeItem;

Expand All @@ -127,8 +128,8 @@ public void SetCompletionItems(
}

private void CreateCompletionListBuilder(
CompletionItem selectedItem,
CompletionItem suggestionModeItem,
RoslynCompletion.CompletionItem selectedItem,
RoslynCompletion.CompletionItem suggestionModeItem,
bool suggestionMode)
{
try
Expand All @@ -153,7 +154,7 @@ private void CreateCompletionListBuilder(
}
}

private void CreateNormalCompletionListItems(IList<CompletionItem> completionItems)
private void CreateNormalCompletionListItems(IList<RoslynCompletion.CompletionItem> completionItems)
{
try
{
Expand All @@ -172,7 +173,7 @@ private void CreateNormalCompletionListItems(IList<CompletionItem> completionIte
}
}

private VSCompletion GetVSCompletion(CompletionItem item, string displayText = null)
private VSCompletion GetVSCompletion(RoslynCompletion.CompletionItem item, string displayText = null)
{
if (!CompletionItemMap.TryGetValue(item, out var value))
{
Expand All @@ -185,7 +186,7 @@ private VSCompletion GetVSCompletion(CompletionItem item, string displayText = n
return value;
}

public CompletionItem GetCompletionItem(VSCompletion completion)
public RoslynCompletion.CompletionItem GetCompletionItem(VSCompletion completion)
{
// Linear search is ok since this is only called by the user manually selecting
// an item. Creating a reverse mapping uses too much memory and affects GCs.
Expand Down
1 change: 1 addition & 0 deletions src/EditorFeatures/Core.Wpf/EditorFeatures.Wpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<NoWarn>$(NoWarn);0618</NoWarn>
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
<PlatformTarget>AnyCPU</PlatformTarget>
<OutputType>Library</OutputType>
Expand Down
4 changes: 3 additions & 1 deletion src/EditorFeatures/Core.Wpf/GlyphExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using System;
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.VisualStudio.Imaging;
using Microsoft.VisualStudio.Imaging.Interop;

namespace Microsoft.CodeAnalysis.Editor.Wpf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Microsoft.CodeAnalysis.Text;
using Microsoft.CodeAnalysis.Text.Shared.Extensions;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Utilities;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
Expand All @@ -23,20 +24,22 @@ internal class InlineRenameService : IInlineRenameService
private readonly IAsynchronousOperationListener _asyncListener;
private readonly IEnumerable<IRefactorNotifyService> _refactorNotifyServices;
private readonly ITextBufferFactoryService _textBufferFactoryService;

private readonly IFeatureServiceFactory _featureServiceFactory;

This comment was marked as resolved.

private InlineRenameSession _activeRenameSession;

[ImportingConstructor]
public InlineRenameService(
IWaitIndicator waitIndicator,
ITextBufferAssociatedViewService textBufferAssociatedViewService,
ITextBufferFactoryService textBufferFactoryService,
IFeatureServiceFactory featureServiceFactory,
[ImportMany] IEnumerable<IRefactorNotifyService> refactorNotifyServices,
IAsynchronousOperationListenerProvider listenerProvider)
{
_waitIndicator = waitIndicator;
_textBufferAssociatedViewService = textBufferAssociatedViewService;
_textBufferFactoryService = textBufferFactoryService;
_featureServiceFactory = featureServiceFactory;
_refactorNotifyServices = refactorNotifyServices;
_asyncListener = listenerProvider.GetListener(FeatureAttribute.Rename);
}
Expand Down Expand Up @@ -67,6 +70,7 @@ public InlineRenameSessionInfo StartInlineSession(
_waitIndicator,
_textBufferAssociatedViewService,
_textBufferFactoryService,
_featureServiceFactory,
_refactorNotifyServices,
_asyncListener);

Expand Down
13 changes: 12 additions & 1 deletion src/EditorFeatures/Core.Wpf/InlineRename/InlineRenameSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,20 @@
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Utilities;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
{
internal partial class InlineRenameSession : ForegroundThreadAffinitizedObject, IInlineRenameSession
internal partial class InlineRenameSession : ForegroundThreadAffinitizedObject, IInlineRenameSession, IFeatureController
{
private readonly Workspace _workspace;
private readonly InlineRenameService _renameService;
private readonly IWaitIndicator _waitIndicator;
private readonly ITextBufferAssociatedViewService _textBufferAssociatedViewService;
private readonly ITextBufferFactoryService _textBufferFactoryService;
private readonly IFeatureService _featureService;
private readonly IFeatureDisableToken _completionDisabledToken;
private readonly IEnumerable<IRefactorNotifyService> _refactorNotifyServices;
private readonly IDebuggingWorkspaceService _debuggingWorkspaceService;
private readonly IAsynchronousOperationListener _asyncListener;
Expand Down Expand Up @@ -98,6 +101,7 @@ public InlineRenameSession(
IWaitIndicator waitIndicator,
ITextBufferAssociatedViewService textBufferAssociatedViewService,
ITextBufferFactoryService textBufferFactoryService,
IFeatureServiceFactory featureServiceFactory,
IEnumerable<IRefactorNotifyService> refactorNotifyServices,
IAsynchronousOperationListener asyncListener) : base(assertIsForeground: true)
{
Expand All @@ -119,6 +123,10 @@ public InlineRenameSession(
_textBufferAssociatedViewService = textBufferAssociatedViewService;
_textBufferAssociatedViewService.SubjectBuffersConnected += OnSubjectBuffersConnected;

// Disable completion when an inline rename session starts
_featureService = featureServiceFactory.GlobalFeatureService;
_completionDisabledToken = _featureService.Disable(PredefinedEditorFeatureNames.InteractivePopup, this);

_renameService = renameService;
_waitIndicator = waitIndicator;
_refactorNotifyServices = refactorNotifyServices;
Expand Down Expand Up @@ -317,6 +325,9 @@ private void Dismiss(bool rollbackTemporaryEdits)
_workspace.WorkspaceChanged -= OnWorkspaceChanged;
_textBufferAssociatedViewService.SubjectBuffersConnected -= OnSubjectBuffersConnected;

// Reenable completion now that the inline rename session is done
_completionDisabledToken.Dispose();

foreach (var textBuffer in _openTextBuffers.Keys)
{
var document = textBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System;
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion;
using Microsoft.VisualStudio.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;

Expand All @@ -12,6 +13,7 @@ namespace Microsoft.CodeAnalysis.Editor.CommandHandlers
[Export(typeof(VSCommanding.ICommandHandler))]
[ContentType(ContentTypeNames.RoslynContentType)]
[Name(PredefinedCommandHandlerNames.IntelliSense)]
[Order(After = PredefinedCompletionNames.CompletionCommandHandler)]
internal sealed class IntelliSenseCommandHandler : AbstractIntelliSenseCommandHandler
{
[ImportingConstructor]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Microsoft.CodeAnalysis.SignatureHelp;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion;
using Microsoft.VisualStudio.Text.Editor.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.VisualStudio.Utilities;
Expand All @@ -26,6 +27,7 @@ namespace Microsoft.CodeAnalysis.Editor.CommandHandlers
[ContentType(ContentTypeNames.RoslynContentType)]
[Name(PredefinedCommandHandlerNames.SignatureHelp)]
[Order(Before = PredefinedCommandHandlerNames.Completion)]
[Order(After = PredefinedCompletionNames.CompletionCommandHandler)]
internal class SignatureHelpCommandHandler :
ForegroundThreadAffinitizedObject,
IChainedCommandHandler<TypeCharCommandArgs>,
Expand Down
1 change: 1 addition & 0 deletions src/EditorFeatures/Core/EditorFeatures.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<NoWarn>$(NoWarn);0618</NoWarn>
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
<PlatformTarget>AnyCPU</PlatformTarget>
<OutputType>Library</OutputType>
Expand Down
Loading