Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,21 @@ protected override IProjectionBuffer GetAdjustedBuffer(int contextPoint, Documen
// where [] denotes CurrentStatementSpan, should use the start of CurrentStatementSpan
// as the adjusted context, and should not place a semicolon before debuggerMappedSpan.
// Not doing either of those would place debuggerMappedSpan outside the for loop.
separatorBeforeDebuggerMappedSpan = string.Empty;
// We use a space as the separator in this case (instead of an empty string) to help
// the vs editor out and not have a projection seam at the location they will bring
// up completion.
separatorBeforeDebuggerMappedSpan = " ";
adjustedStart = token.Parent.SpanStart;
}

var beforeAdjustedStart = ContextBuffer.CurrentSnapshot.CreateTrackingSpan(Span.FromBounds(0, adjustedStart), SpanTrackingMode.EdgeNegative);
var afterAdjustedStart = ContextBuffer.CurrentSnapshot.CreateTrackingSpanFromIndexToEnd(adjustedStart, SpanTrackingMode.EdgePositive);

return ProjectionBufferFactoryService.CreateProjectionBuffer(
projectionEditResolver: null,
sourceSpans: [beforeAdjustedStart, separatorBeforeDebuggerMappedSpan, debuggerMappedSpan, StatementTerminator, afterAdjustedStart],
options: ProjectionBufferOptions.None,
contentType: ContentType);
projectionEditResolver: null,
sourceSpans: [beforeAdjustedStart, separatorBeforeDebuggerMappedSpan, debuggerMappedSpan, StatementTerminator, afterAdjustedStart],
options: ProjectionBufferOptions.None,
contentType: ContentType);
}

public override bool CompletionStartsOnQuestionMark
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,29 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.DebuggerIntelliSense
End Using
End Function

<WpfFact>
Public Async Function SingleStatementBlockInvokeCompletion() As Task
Dim text = <Workspace>
<Project Language="C#" CommonReferences="true">
<Document>class Program
{
static void Main()
{
for (int variable1 = 0; variable1 &lt; 10; variable1++)
[|Console.Write(0);|]
int variable2 = 0;
}
}</Document>
</Project>
</Workspace>

Using state = TestState.CreateCSharpTestState(text, False)
Await state.WaitForAsynchronousOperationsAsync()
state.SendInvokeCompletionList()
Await state.AssertCompletionItemsContainAll("variable1")
End Using
End Function

<WpfFact>
Public Async Function SignatureHelpInParameterizedConstructor() As Task
Dim text = <Workspace>
Expand Down
Loading