1 write to CursorPosition
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestHostDocument.cs (1)
110this.CursorPosition = cursorPosition;
95 references to CursorPosition
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (31)
Classification\SyntacticTaggerTests.cs (1)
72var snapshot = subjectBuffer.Insert(document.CursorPosition.Value, """
Completion\CompletionProviders\AbstractCSharpCompletionProviderTests.cs (1)
172var position = hostDocument.CursorPosition.Value;
Completion\CompletionProviders\CrefCompletionProviderTests.cs (1)
462var completionList = await GetCompletionListAsync(service, document, hostDocument.CursorPosition!.Value, RoslynTrigger.Invoke);
Completion\CompletionProviders\ObjectInitializerCompletionProviderTests.cs (2)
689var position = hostDocument.CursorPosition.Value; 1281var position = hostDocument.CursorPosition.Value;
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (12)
2466Contract.ThrowIfNull(testDocument.CursorPosition); 2467var position = testDocument.CursorPosition.Value; 2719Contract.ThrowIfNull(testDocument.CursorPosition); 2720var position = testDocument.CursorPosition.Value; 2774Contract.ThrowIfNull(testDocument.CursorPosition); 2775var cursorPosition = testDocument.CursorPosition.Value; 3064Contract.ThrowIfNull(testDocument.CursorPosition); 3065var completionList = await GetCompletionListAsync(service, document, testDocument.CursorPosition.Value, CompletionTrigger.Invoke); 3200Contract.ThrowIfNull(testDocument.CursorPosition); 3201var completionList = await GetCompletionListAsync(service, document, testDocument.CursorPosition.Value, CompletionTrigger.Invoke); 3254Contract.ThrowIfNull(testDocument.CursorPosition); 3255var completionList = await GetCompletionListAsync(service, document, testDocument.CursorPosition.Value, CompletionTrigger.Invoke);
Completion\CompletionProviders\SymbolCompletionProviderTests_NoInteractive.cs (1)
374var position = testDocument.CursorPosition.Value;
Debugging\DataTipInfoGetterTests.cs (1)
49var position = testHostDocument.CursorPosition.Value;
Debugging\LocationInfoGetterTests.cs (1)
27var position = testDocument.CursorPosition.Value;
Debugging\ProximityExpressionsGetterTests.cs (1)
73var caretPosition = testDocument.CursorPosition.Value;
EncapsulateField\EncapsulateFieldTestState.cs (1)
34_testDocument = Workspace.Documents.Single(d => d.CursorPosition.HasValue || d.SelectedSpans.Any());
Formatting\FormattingEngineTests.cs (1)
2920var typedChar = subjectDocument.GetTextBuffer().CurrentSnapshot.GetText(subjectDocument.CursorPosition!.Value - 1, 1);
Formatting\Indentation\SmartIndenterTests.cs (1)
3471var indentationLine = projectedDocument.GetTextBuffer().CurrentSnapshot.GetLineFromPosition(projectedDocument.CursorPosition.Value);
Formatting\Indentation\SmartTokenFormatterFormatRangeTests.cs (2)
3381var typedChar = textBuffer.CurrentSnapshot.GetText(subjectDocument.CursorPosition.Value - 1, 1); 3410var position = testDocument.CursorPosition.Value;
QuickInfo\DiagnosticAnalyzerQuickInfoSourceTests.cs (1)
216var position = testDocument.CursorPosition.Value;
QuickInfo\SemanticQuickInfoSourceTests.cs (3)
43var position = testDocument.CursorPosition.GetValueOrDefault(); 120var position = sourceDocument.CursorPosition!.Value; 272var position = sourceDocument.CursorPosition!.Value;
QuickInfo\SyntacticQuickInfoSourceTests.cs (1)
603var position = testDocument.CursorPosition.Value;
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (42)
AbstractCommandHandlerTestState.cs (2)
77var cursorDocument = Workspace.Documents.First(d => d.CursorPosition.HasValue || d.SelectedSpans.Any(ss => ss.IsEmpty)); 81var cursorPosition = cursorDocument.CursorPosition ?? cursorDocument.SelectedSpans.First(ss => ss.IsEmpty).Start;
AbstractTypingCommandHandlerTest.cs (1)
35view.Caret.MoveTo(new SnapshotPoint(view.TextSnapshot, testDocument.CursorPosition.Value));
AutomaticCompletion\AbstractAutomaticBraceCompletionTests.cs (1)
153var openingPoint = new SnapshotPoint(document.GetTextBuffer().CurrentSnapshot, document.CursorPosition.Value);
AutomaticCompletion\AbstractAutomaticLineEnderTests.cs (2)
82view.Caret.MoveTo(new SnapshotPoint(buffer.CurrentSnapshot, workspace.Documents.Single(d => d.CursorPosition.HasValue).CursorPosition.Value));
BraceMatching\AbstractBraceMatcherTests.cs (1)
26var position = workspace.Documents.Single().CursorPosition.Value;
CompleteStatement\AbstractCompleteStatementTests.cs (2)
103Assert.True(testDocument.CursorPosition.HasValue || testDocument.SelectedSpans.Any(), "No caret position or selected spans are set!"); 104var startCaretPosition = testDocument.CursorPosition ?? testDocument.SelectedSpans.Last().End;
Completion\AbstractCompletionProviderTests.cs (5)
811var position = testWorkspace.Documents.Single(d => d.Name == "SourceDocument").CursorPosition.Value; 867var position = testWorkspace.Documents.Single(d => d.Name == "SourceDocument").CursorPosition.Value; 896var position = testWorkspace.Documents.First().CursorPosition.Value; 1045var position = hostDocument.CursorPosition.Value; 1095var position = hostDocument.CursorPosition.Value;
Diagnostics\GenerateType\GenerateTypeTestState.cs (1)
34_testDocument = Workspace.Documents.SingleOrDefault(d => d.CursorPosition.HasValue);
DocumentationComments\AbstractDocumentationCommentTests.cs (3)
135Assert.True(testDocument.CursorPosition.HasValue, "No caret position set!"); 136var startCaretPosition = testDocument.CursorPosition.Value; 156view.Caret.MoveTo(new SnapshotPoint(view.TextSnapshot, testDocument.CursorPosition.Value));
DocumentationComments\AbstractXmlTagCompletionTests.cs (1)
32view.Caret.MoveTo(new SnapshotPoint(view.TextSnapshot, testDocument.CursorPosition.Value));
ExtractInterface\ExtractInterfaceTestState.cs (4)
55_testDocument = Workspace.Documents.SingleOrDefault(d => d.CursorPosition.HasValue); 78_testDocument.CursorPosition.Value, 87_testDocument.CursorPosition.Value, 100new TextSpan(_testDocument.CursorPosition.Value, 1),
Formatting\CoreFormatterTestsBase.cs (2)
139view.Caret.MoveTo(new SnapshotPoint(view.TextSnapshot, testDocument.CursorPosition.Value)); 246view.Caret.MoveTo(new SnapshotPoint(view.TextSnapshot, testDocument.CursorPosition.Value));
GoToAdjacentMember\AbstractGoToAdjacentMemberTests.cs (2)
46hostDocument.CursorPosition.Value, 69hostDocument.CursorPosition.Value,
SignatureHelp\AbstractSignatureHelpProviderTests.cs (2)
348var cursorPosition = testWorkspace.Documents.First(d => d.Name == "SourceDocument").CursorPosition.Value; 467var cursorPosition = testWorkspace.Documents.Single(d => d.Name == "SourceDocument").CursorPosition.Value;
Structure\AbstractSyntaxStructureProviderTests.cs (4)
46Contract.ThrowIfNull(hostDocument.CursorPosition); 47var position = hostDocument.CursorPosition.Value; 67Contract.ThrowIfNull(hostDocument.CursorPosition); 68var position = hostDocument.CursorPosition.Value;
TextStructureNavigation\AbstractTextStructureNavigationTests.cs (1)
34var position = document.CursorPosition!.Value;
Workspaces\EditorTestHostDocument.cs (2)
128if (this.CursorPosition.HasValue) 130_textView.Caret.MoveTo(new SnapshotPoint(_textView.TextSnapshot, CursorPosition.Value));
Workspaces\EditorTestWorkspace.cs (4)
382documentWithSpan.CursorPosition.HasValue && 383(matchingSpan.Contains(documentWithSpan.CursorPosition.Value) || matchingSpan.End == documentWithSpan.CursorPosition.Value)) 385var caretOffsetInSpan = documentWithSpan.CursorPosition.Value - matchingSpan.Start;
Workspaces\TestWorkspaceFixture.cs (2)
43_currentDocument = _workspace.Documents.First(d => d.CursorPosition.HasValue); 44Position = _currentDocument.CursorPosition.Value;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (5)
Completion\CompletionServiceTests.cs (1)
47var caretPosition = workspace.DocumentWithCursor.CursorPosition ?? throw new InvalidOperationException();
RenameTracking\RenameTrackingTestState.cs (1)
84_view.Caret.MoveTo(new SnapshotPoint(_view.TextSnapshot, HostDocument.CursorPosition.Value));
SymbolFinder\FindSymbolAtPositionTests.cs (2)
20var position = workspace.Documents.Single(d => d.CursorPosition.HasValue).CursorPosition!.Value;
ValueTracking\AbstractBaseValueTrackingTests.cs (1)
30var textSpan = new TextSpan(cursorDocument.CursorPosition!.Value, 0);
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
RelatedDocuments\AbstractRelatedDocumentsTests.cs (2)
28var caretDocument = workspace.Documents.Single(d => d.CursorPosition.HasValue); 29var caretPosition = caretDocument.CursorPosition!.Value;
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestWorkspace`1.cs (1)
243=> Documents.Single(d => d.CursorPosition.HasValue && !d.IsLinkFile);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
F1Help\F1HelpTests.cs (1)
28var caret = workspace.Documents.First().CursorPosition;
Microsoft.VisualStudio.LanguageServices.UnitTests (13)
AbstractTextViewFilterTests.vb (2)
48TestSpan(workspace, projected, projected.CursorPosition.Value, matchingSpan.End) 49TestSpan(workspace, projected, matchingSpan.End, projected.CursorPosition.Value)
ExtractInterface\ExtractInterfaceViewModelTests.vb (2)
294If (Not doc.CursorPosition.HasValue) Then 299Dim token = Await tree.GetTouchingWordAsync(doc.CursorPosition.Value, workspaceDoc.Project.Services.GetService(Of ISyntaxFactsService)(), CancellationToken.None)
Progression\ProgressionTestState.vb (1)
80Return SymbolFinder.FindSymbolAtPositionAsync(document, hostDocument.CursorPosition.Value)
Snippets\SnippetExpansionClientTestsHelper.vb (3)
32Dim endPositionInSurfaceBuffer = surfaceBufferDocument.CursorPosition.Value 57Dim cursorPosition = document.CursorPosition.Value 83Dim endPosition = document.CursorPosition.Value
Venus\DocumentServiceTests.vb (3)
44Assert.Equal(projectedDocument.CursorPosition.Value, spans(0).Span.Start) 70Assert.Equal(projectedDocument.CursorPosition.Value, spans(0).Span.Start) 76Assert.Equal(projectedDocument.CursorPosition.Value + 1, spans(2).Span.Start)
VsNavInfo\VsNavInfoTests.vb (2)
831Dim position As Integer = hostDocument.CursorPosition.Value 869Dim position As Integer = hostDocument.CursorPosition.Value