Exemple #1
0
        public void NavigateStep18()
        {
            var project = PsiNavigationHelper.GetProjectByName(Solution, "Tutorial3_WhatsNewReSharper2016.3");
            var file    = PsiNavigationHelper.GetCssFile(project, "LanguageInjections.cs", 1);
            var node    = PsiNavigationHelper.GetAnyTreeNodeForStep(file, "red", 1);

            var range = node.GetDocumentRange();

            if (!range.IsValid())
            {
                return;
            }
            var document    = range.Document;
            var projectFile = DocumentManager.TryGetProjectFile(document);

            if (projectFile == null)
            {
                return;
            }
            var textControl = EditorManager.OpenProjectFile(projectFile, true);

            textControl?.Caret.MoveTo(range.TextRange.EndOffset, CaretVisualPlacement.DontScrollIfVisible);
        }