public static string[] FindFilterFiles(UIHierarchyItem[] items)
        {
            List <string> result = new List <string>();

            foreach (UIHierarchyItem selItem in items)
            {
                if (selItem.Object is ProjectItem item &&
                    item.GetFullPath() is string projectItemPath &&
                    LintableFiles.IsLintableTsOrTsxFile(projectItemPath))
                {
                    result.Add(projectItemPath);
                }
Exemple #2
0
        public static IEnumerable <string> FindInProjectItem(ProjectItem projectItem)
        {
            string itemPath = projectItem.GetFullPath();

            if (LintableFiles.IsLintableTsOrTsxFile(itemPath))
            {
                yield return(itemPath);
            }
            // Checking the ignore pattern here is an optimization that prevents us iterating ignored folders
            if (projectItem.ProjectItems == null || LintableFiles.ContainsIgnorePattern(itemPath))
            {
                yield break;
            }
            foreach (ProjectItem subProjectItem in projectItem.ProjectItems)
            {
                foreach (var item in FindInProjectItem(subProjectItem))
                {
                    yield return(item);
                }
            }
        }