当前位置: 首页>>代码示例>>C#>>正文


C# RenameTrackingTestState.MoveCaret方法代码示例

本文整理汇总了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");
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:17,代码来源:RenameTrackingTaggerProviderTests.cs

示例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();
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:17,代码来源:RenameTrackingTaggerProviderTests.cs

示例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");
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:16,代码来源:RenameTrackingTaggerProviderTests.cs

示例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");
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:16,代码来源:RenameTrackingTaggerProviderTests.cs

示例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();
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:16,代码来源:RenameTrackingTaggerProviderTests.cs

示例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]");
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:15,代码来源:RenameTrackingTaggerProviderTests.cs

示例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);
            }
        }
开发者ID:nileshjagtap,项目名称:roslyn,代码行数:16,代码来源:RenameTrackingTaggerProviderTests.cs


注:本文中的Microsoft.CodeAnalysis.Editor.UnitTests.RenameTracking.RenameTrackingTestState.MoveCaret方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。