diff --git a/src/EditorFeatures/CSharp/QuickInfo/SyntacticQuickInfoProvider.cs b/src/EditorFeatures/CSharp/QuickInfo/SyntacticQuickInfoProvider.cs
index 729030f62aa8da47f4441c2e082fec466aafa932..3339a8c76887bbe455afa4a53fa4bf0e69590429 100644
--- a/src/EditorFeatures/CSharp/QuickInfo/SyntacticQuickInfoProvider.cs
+++ b/src/EditorFeatures/CSharp/QuickInfo/SyntacticQuickInfoProvider.cs
@@ -84,7 +84,7 @@ internal class SyntacticQuickInfoProvider : AbstractQuickInfoProvider
}
var span = new SnapshotSpan(textSnapshot, Span.FromBounds(spanStart, spanEnd));
- return this.CreateElisionBufferDeferredContent(span);
+ return this.CreateProjectionBufferDeferredContent(span);
}
private static bool IsScopeBlock(SyntaxNode node)
diff --git a/src/EditorFeatures/CSharpTest/QuickInfo/SyntacticQuickInfoSourceTests.cs b/src/EditorFeatures/CSharpTest/QuickInfo/SyntacticQuickInfoSourceTests.cs
index ea1fa2108836c3752456401b83d0bc1d3f8e1ee1..40c0de5f52564f68fca961f586a52a22af9fc4f0 100644
--- a/src/EditorFeatures/CSharpTest/QuickInfo/SyntacticQuickInfoSourceTests.cs
+++ b/src/EditorFeatures/CSharpTest/QuickInfo/SyntacticQuickInfoSourceTests.cs
@@ -292,16 +292,9 @@ private IQuickInfoProvider CreateProvider(TestWorkspace workspace)
var state = await provider.GetItemAsync(document, position, cancellationToken: CancellationToken.None);
Assert.NotNull(state);
- var viewHostingControl = (ViewHostingControl)((ElisionBufferDeferredContent)state.Content).Create();
- try
- {
- var actualContent = viewHostingControl.ToString();
- Assert.Equal(expectedContent, actualContent);
- }
- finally
- {
- viewHostingControl.TextView_TestOnly.Close();
- }
+ var viewHostingControl = (ViewHostingControl)((ProjectionBufferDeferredContent)state.Content).Create();
+ var actualContent = viewHostingControl.GetText_TestOnly();
+ Assert.Equal(expectedContent, actualContent);
}
protected override Task TestInMethodAsync(string code, string expectedContent, string expectedDocumentationComment = null)
diff --git a/src/EditorFeatures/Core/EditorFeatures.csproj b/src/EditorFeatures/Core/EditorFeatures.csproj
index 6099a662a8abd4ccb4db3dc6ff9ee2992e48df9a..db68ede2853f51f51bbb40116fbff1f916a99722 100644
--- a/src/EditorFeatures/Core/EditorFeatures.csproj
+++ b/src/EditorFeatures/Core/EditorFeatures.csproj
@@ -573,7 +573,7 @@
-
+
diff --git a/src/EditorFeatures/Core/Implementation/IntelliSense/QuickInfo/DeferredContent/ElisionBufferDeferredContent.cs b/src/EditorFeatures/Core/Implementation/IntelliSense/QuickInfo/DeferredContent/ProjectionBufferDeferredContent.cs
similarity index 87%
rename from src/EditorFeatures/Core/Implementation/IntelliSense/QuickInfo/DeferredContent/ElisionBufferDeferredContent.cs
rename to src/EditorFeatures/Core/Implementation/IntelliSense/QuickInfo/DeferredContent/ProjectionBufferDeferredContent.cs
index ed6ead8bcf5f21a2373827f2669335498130e81a..87e7080a40bed7b3529905c3d29484d3a61cc5cf 100644
--- a/src/EditorFeatures/Core/Implementation/IntelliSense/QuickInfo/DeferredContent/ElisionBufferDeferredContent.cs
+++ b/src/EditorFeatures/Core/Implementation/IntelliSense/QuickInfo/DeferredContent/ProjectionBufferDeferredContent.cs
@@ -14,10 +14,10 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.QuickInfo
{
///
/// Creates quick info content out of the span of an existing snapshot. The span will be
- /// used to create an elision buffer out that will then be displayed in the quick info
+ /// used to create an projection buffer out that will then be displayed in the quick info
/// window.
///
- internal class ElisionBufferDeferredContent : IDeferredQuickInfoContent
+ internal class ProjectionBufferDeferredContent : IDeferredQuickInfoContent
{
private readonly SnapshotSpan _span;
private readonly IProjectionBufferFactoryService _projectionBufferFactoryService;
@@ -26,7 +26,7 @@ internal class ElisionBufferDeferredContent : IDeferredQuickInfoContent
private readonly IContentType _contentType;
private readonly ITextViewRoleSet _roleSet;
- public ElisionBufferDeferredContent(
+ public ProjectionBufferDeferredContent(
SnapshotSpan span,
IProjectionBufferFactoryService projectionBufferFactoryService,
IEditorOptionsFactoryService editorOptionsFactoryService,
@@ -63,9 +63,9 @@ private IWpfTextView CreateView(ITextBuffer buffer)
return view;
}
- private IElisionBuffer CreateBuffer()
+ private IProjectionBuffer CreateBuffer()
{
- return _projectionBufferFactoryService.CreateElisionBufferWithoutIndentation(
+ return _projectionBufferFactoryService.CreateProjectionBufferWithoutIndentation(
_editorOptionsFactoryService.GlobalOptions, _contentType, _span);
}
}
diff --git a/src/EditorFeatures/Core/Implementation/IntelliSense/QuickInfo/Providers/AbstractQuickInfoProvider.cs b/src/EditorFeatures/Core/Implementation/IntelliSense/QuickInfo/Providers/AbstractQuickInfoProvider.cs
index 01394b77c401073981a50b9fe5dcb8b943a49c6d..d5068d52c9b51c47b7fb77c2029c3196abae4f96 100644
--- a/src/EditorFeatures/Core/Implementation/IntelliSense/QuickInfo/Providers/AbstractQuickInfoProvider.cs
+++ b/src/EditorFeatures/Core/Implementation/IntelliSense/QuickInfo/Providers/AbstractQuickInfoProvider.cs
@@ -151,9 +151,9 @@ protected IDeferredQuickInfoContent CreateGlyphDeferredContent(ISymbol symbol)
return new DocumentationCommentDeferredContent(documentationComment, _typeMap);
}
- protected IDeferredQuickInfoContent CreateElisionBufferDeferredContent(SnapshotSpan span)
+ protected IDeferredQuickInfoContent CreateProjectionBufferDeferredContent(SnapshotSpan span)
{
- return new ElisionBufferDeferredContent(
+ return new ProjectionBufferDeferredContent(
span, _projectionBufferFactoryService, _editorOptionsFactoryService, _textEditorFactoryService);
}
}
diff --git a/src/EditorFeatures/Core/Implementation/Structure/BlockTagState.cs b/src/EditorFeatures/Core/Implementation/Structure/BlockTagState.cs
index 424449fd8d27f20591639a6c3daa53ad4da56f64..9b9d87342719bb4d2ba759bd2677d152d105ed2d 100644
--- a/src/EditorFeatures/Core/Implementation/Structure/BlockTagState.cs
+++ b/src/EditorFeatures/Core/Implementation/Structure/BlockTagState.cs
@@ -156,7 +156,7 @@ private Span TrimStartingNewlines(Span span)
private ITextBuffer CreateElisionBufferWithoutIndentation(
ITextBuffer dataBuffer, Span shortHintSpan)
{
- return _projectionBufferFactoryService.CreateElisionBufferWithoutIndentation(
+ return _projectionBufferFactoryService.CreateProjectionBufferWithoutIndentation(
_editorOptionsFactoryService.GlobalOptions,
contentType: null,
exposedSpans: new SnapshotSpan(dataBuffer.CurrentSnapshot, shortHintSpan));
diff --git a/src/EditorFeatures/Core/Shared/Extensions/IProjectionBufferFactoryServiceExtensions.cs b/src/EditorFeatures/Core/Shared/Extensions/IProjectionBufferFactoryServiceExtensions.cs
index 9938b814b8e252381a2960b8f6cbdea0c704a760..7fac9c5926f037bea9dddc56028c1a597b20f487 100644
--- a/src/EditorFeatures/Core/Shared/Extensions/IProjectionBufferFactoryServiceExtensions.cs
+++ b/src/EditorFeatures/Core/Shared/Extensions/IProjectionBufferFactoryServiceExtensions.cs
@@ -30,19 +30,19 @@ internal static class IProjectionBufferFactoryServiceExtensions
[BaseDefinition("projection")]
public static readonly ContentTypeDefinition RoslynPreviewContentTypeDefinition;
- public static IElisionBuffer CreateElisionBufferWithoutIndentation(
+ public static IProjectionBuffer CreateProjectionBufferWithoutIndentation(
this IProjectionBufferFactoryService factoryService,
IEditorOptions editorOptions,
IContentType contentType = null,
params SnapshotSpan[] exposedSpans)
{
- return factoryService.CreateElisionBufferWithoutIndentation(
+ return factoryService.CreateProjectionBufferWithoutIndentation(
editorOptions,
contentType,
(IEnumerable)exposedSpans);
}
- public static IElisionBuffer CreateElisionBufferWithoutIndentation(
+ public static IProjectionBuffer CreateProjectionBufferWithoutIndentation(
this IProjectionBufferFactoryService factoryService,
IEditorOptions editorOptions,
IContentType contentType,
@@ -61,37 +61,55 @@ internal static class IProjectionBufferFactoryServiceExtensions
}
contentType = contentType ?? factoryService.ProjectionContentType;
- var elisionBuffer = factoryService.CreateElisionBuffer(
- null, spans, ElisionBufferOptions.None, contentType);
+ var projectionBuffer = factoryService.CreateProjectionBuffer(
+ projectionEditResolver: null,
+ sourceSpans: Array.Empty