public void SigHelpInClass() { using (PythonEditor view = new PythonEditor()) { view.TypeAndWaitForAnalysis("class C(): pass\n"); view.MoveCaret(1, 9); view.ParamInfo(); view.View.AssertNoIntellisenseSession(); } }
public void CompletionsAtEndOfLastChildScope() { using (PythonEditor view = new PythonEditor(@"class A: def f(param1, param2): y = 234 class B: pass ")) { view.MoveCaret(5, 9); view.TypeAndWaitForAnalysis("p"); view.MemberList(); using (var sh = view.View.WaitForSession <ICompletionSession>()) { AssertUtil.ContainsAtLeast(sh.Session.Completions(), "param1", "param2"); } } }
public void NewlineWithinComment() { using (PythonEditor 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 (PythonEditor 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 (PythonEditor 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 (PythonEditor 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()); } }