本文整理汇总了C#中Microsoft.CodeAnalysis.Editor.UnitTests.RenameTracking.RenameTrackingTestState.MoveCaret方法的典型用法代码示例。如果您正苦于以下问题:C# RenameTrackingTestState.MoveCaret方法的具体用法?C# RenameTrackingTestState.MoveCaret怎么用?C# RenameTrackingTestState.MoveCaret使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.CodeAnalysis.Editor.UnitTests.RenameTracking.RenameTrackingTestState
的用法示例。
在下文中一共展示了RenameTrackingTestState.MoveCaret方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenameTrackingThroughEmptyStringWithCaretMove
public void RenameTrackingThroughEmptyStringWithCaretMove()
{
var code = @"
class C$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.Backspace();
state.MoveCaret(-4);
state.MoveCaret(4);
state.AssertNoTag();
state.EditorOperations.InsertText("D");
state.AssertTag("C", "D");
}
}
示例2: RenameTrackingNotThroughEmptyStringResumeOnDifferentSpace
public void RenameTrackingNotThroughEmptyStringResumeOnDifferentSpace()
{
var code = @"
class C$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.Backspace();
// Move to previous space
state.MoveCaret(-1);
state.EditorOperations.InsertText("D");
state.AssertNoTag();
}
}
示例3: RenameTrackingOnBothSidesOfIdentifier
public void RenameTrackingOnBothSidesOfIdentifier()
{
var code = @"
class $$Def
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("Abc");
state.AssertTag("Def", "AbcDef");
state.MoveCaret(3);
state.EditorOperations.InsertText("Ghi");
state.AssertTag("Def", "AbcDefGhi");
}
}
示例4: RenameTrackingThroughIllegalStartCharacter
public void RenameTrackingThroughIllegalStartCharacter()
{
var code = @"
class $$abc
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("9");
state.AssertNoTag();
state.MoveCaret(-1);
state.EditorOperations.InsertText("t");
state.AssertTag("abc", "t9abc");
}
}
示例5: RenameTrackingNotOnSquareBracketsInCSharp
public void RenameTrackingNotOnSquareBracketsInCSharp()
{
var code = @"
class $$C
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("[");
state.AssertNoTag();
state.MoveCaret(1);
state.EditorOperations.InsertText("]");
state.AssertNoTag();
}
}
示例6: RenameTrackingHandlesSquareBracketsAsVisualBasicEscape
public void RenameTrackingHandlesSquareBracketsAsVisualBasicEscape()
{
var code = @"
Class $$C
End Class";
using (var state = new RenameTrackingTestState(code, LanguageNames.VisualBasic))
{
state.EditorOperations.InsertText("[");
state.AssertNoTag();
state.MoveCaret(1);
state.EditorOperations.InsertText("]");
state.AssertTag("C", "[C]");
}
}
示例7: RenameTrackingNotOnSquareBracketsInCSharp
public async Task RenameTrackingNotOnSquareBracketsInCSharp()
{
var code = @"
class $$C
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("[");
await state.AssertNoTag().ConfigureAwait(true);
state.MoveCaret(1);
state.EditorOperations.InsertText("]");
await state.AssertNoTag().ConfigureAwait(true);
}
}