本文整理匯總了C#中PythonToolsMockTests.PythonEditor.MoveCaret方法的典型用法代碼示例。如果您正苦於以下問題:C# PythonEditor.MoveCaret方法的具體用法?C# PythonEditor.MoveCaret怎麽用?C# PythonEditor.MoveCaret使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PythonToolsMockTests.PythonEditor
的用法示例。
在下文中一共展示了PythonEditor.MoveCaret方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SigHelpInClass
public void SigHelpInClass() {
using (var view = new PythonEditor()) {
view.Type("class C(): pass");
view.MoveCaret(1, 9);
view.ParamInfo();
view.View.AssertNoIntellisenseSession();
}
}
示例2: NewlineWithinComment
public void NewlineWithinComment() {
using (var view = new PythonEditor(@"# comment")) {
view.MoveCaret(1, 1);
view.Enter();
Assert.AreEqual(2, view.CurrentSnapshot.LineCount);
Assert.AreEqual("", view.CurrentSnapshot.GetLineFromLineNumber(0).GetText());
Assert.AreEqual("# comment", view.CurrentSnapshot.GetLineFromLineNumber(1).GetText());
}
using (var view = new PythonEditor(@"# comment")) {
view.MoveCaret(1, 3);
view.Enter();
Assert.AreEqual(2, view.CurrentSnapshot.LineCount);
Assert.AreEqual("# ", view.CurrentSnapshot.GetLineFromLineNumber(0).GetText());
Assert.AreEqual("# comment", view.CurrentSnapshot.GetLineFromLineNumber(1).GetText());
}
using (var view = new PythonEditor(@"# comment")) {
view.MoveCaret(1, 10);
view.Enter();
Assert.AreEqual(2, view.CurrentSnapshot.LineCount);
Assert.AreEqual("# comment", view.CurrentSnapshot.GetLineFromLineNumber(0).GetText());
Assert.AreEqual("", view.CurrentSnapshot.GetLineFromLineNumber(1).GetText());
}
using (var view = new PythonEditor(@" # comment")) {
view.MoveCaret(1, 7);
view.Enter();
Assert.AreEqual(2, view.CurrentSnapshot.LineCount);
Assert.AreEqual(" # ", view.CurrentSnapshot.GetLineFromLineNumber(0).GetText());
Assert.AreEqual(" # comment", view.CurrentSnapshot.GetLineFromLineNumber(1).GetText());
}
}
示例3: CompletionsAtEndOfLastChildScope
public void CompletionsAtEndOfLastChildScope() {
using (var view = new PythonEditor(@"class A:
def f(param1, param2):
y = 234
class B:
pass
")) {
view.MoveCaret(5, 9);
view.Type("p");
view.MemberList();
using (var sh = view.View.WaitForSession<ICompletionSession>()) {
AssertUtil.ContainsAtLeast(sh.Session.Completions(), "param1", "param2");
}
}
}