コード例 #1
0
ファイル: EditorExtensions.cs プロジェクト: m0nguss/roslyn
        public static void InvokeCodeActionList(this AbstractIntegrationTest test)
        {
            test.WaitForAsyncOperations(FeatureAttribute.SolutionCrawler);
            test.WaitForAsyncOperations(FeatureAttribute.DiagnosticService);

            test.VisualStudio.Instance.Editor.ShowLightBulb();
            test.VisualStudio.Instance.Editor.WaitForLightBulbSession();
            test.WaitForAsyncOperations(FeatureAttribute.LightBulb);
        }
コード例 #2
0
ファイル: EditorExtensions.cs プロジェクト: m0nguss/roslyn
 public static void InvokeNavigateToAndPressEnter(this AbstractIntegrationTest test, string text)
 {
     test.ExecuteCommand(WellKnownCommandNames.Edit_GoToAll);
     test.VisualStudio.Instance.Editor.NavigateToSendKeys(text);
     test.WaitForAsyncOperations(FeatureAttribute.NavigateTo);
     test.VisualStudio.Instance.Editor.NavigateToSendKeys("{ENTER}");
 }
コード例 #3
0
        public static void VerifyCurrentTokenType(AbstractIntegrationTest test, string tokenType, TextViewWindow_OutOfProc window)
        {
            test.WaitForAsyncOperations(
                FeatureAttribute.SolutionCrawler,
                FeatureAttribute.DiagnosticService,
                FeatureAttribute.Classification);
            var actualTokenTypes = window.GetCurrentClassifications();

            Assert.Equal(actualTokenTypes.Length, 1);
            Assert.Contains(tokenType, actualTokenTypes[0]);
            Assert.NotEqual("text", tokenType);
        }
コード例 #4
0
        public static void VerifyCodeActions(
            this AbstractIntegrationTest test,
            IEnumerable <string> expectedItems,
            string applyFix       = null,
            bool verifyNotShowing = false,
            bool ensureExpectedItemsAreOrdered = false,
            FixAllScope?fixAllScope            = null,
            bool blockUntilComplete            = true)
        {
            test.VisualStudio.Instance.Editor.ShowLightBulb();
            test.VisualStudio.Instance.Editor.WaitForLightBulbSession();

            if (verifyNotShowing)
            {
                test.VerifyCodeActionsNotShowing();
                return;
            }

            var actions = test.VisualStudio.Instance.Editor.GetLightBulbActions();

            if (expectedItems != null && expectedItems.Any())
            {
                if (ensureExpectedItemsAreOrdered)
                {
                    TestUtilities.ThrowIfExpectedItemNotFoundInOrder(
                        actions,
                        expectedItems);
                }
                else
                {
                    TestUtilities.ThrowIfExpectedItemNotFound(
                        actions,
                        expectedItems);
                }
            }

            if (!string.IsNullOrEmpty(applyFix) || fixAllScope.HasValue)
            {
                test.VisualStudio.Instance.Editor.ApplyLightBulbAction(applyFix, fixAllScope, blockUntilComplete);

                if (blockUntilComplete)
                {
                    // wait for action to complete
                    test.WaitForAsyncOperations(FeatureAttribute.LightBulb);
                }
            }
        }
コード例 #5
0
ファイル: EditorExtensions.cs プロジェクト: m0nguss/roslyn
 public static void InvokeQuickInfo(this AbstractIntegrationTest test)
 {
     test.ExecuteCommand(WellKnownCommandNames.Edit_QuickInfo);
     test.WaitForAsyncOperations(FeatureAttribute.QuickInfo);
 }
コード例 #6
0
ファイル: EditorExtensions.cs プロジェクト: m0nguss/roslyn
 public static void InvokeSignatureHelp(this AbstractIntegrationTest test)
 {
     test.ExecuteCommand(WellKnownCommandNames.Edit_ParameterInfo);
     test.WaitForAsyncOperations(FeatureAttribute.SignatureHelp);
 }
コード例 #7
0
ファイル: CommonExtensions.cs プロジェクト: m0nguss/roslyn
 public static void InvokeCompletionList(AbstractIntegrationTest test)
 {
     test.ExecuteCommand(WellKnownCommandNames.Edit_ListMembers);
     test.WaitForAsyncOperations(FeatureAttribute.CompletionSet);
 }
コード例 #8
0
 public static void SetPersistenceOption(this AbstractIntegrationTest test, bool value)
 {
     test.VisualStudio.Instance.VisualStudioWorkspace.SetPersistenceOption(value);
     test.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
コード例 #9
0
 public static void SetOptionInfer(this AbstractIntegrationTest test, ProjectUtils.Project project, bool value)
 {
     test.VisualStudio.Instance.VisualStudioWorkspace.SetOptionInfer(project.Name, value);
     test.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
コード例 #10
0
 public static void RemoveProjectReference(this AbstractIntegrationTest test, ProjectUtils.ProjectReference projectReferenceName, ProjectUtils.Project projectName)
 {
     test.VisualStudio.Instance.SolutionExplorer.RemoveProjectReference(projectName.Name, projectReferenceName.Name);
     test.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
コード例 #11
0
 public static void AddMetadataReference(this AbstractIntegrationTest test, ProjectUtils.AssemblyReference referenceName, ProjectUtils.Project projectName)
 {
     test.VisualStudio.Instance.SolutionExplorer.AddMetadataReference(referenceName.Name, projectName.Name);
     test.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }