private void RebuildSymbolTree(object fileTag, IBaseNode doxyTree) { DoxygenNode lastEntity = null; if (tvTree.SelectedNode != null) { lastEntity = tvTree.SelectedNode.Tag as DoxygenNode; } TreeNode newSelectedNode = null; // Find file node from tag TreeNode fileNode = FindRootSymbolNode(fileTag); Debug.Assert(fileNode != null); tvTree.BeginUpdate(); fileNode.Nodes.Clear(); if (doxyTree != null) { List <TreeNode> selNodes = BuildSymbolTree(doxyTree, fileNode, lastEntity); if (selNodes.Count == 1) { newSelectedNode = selNodes.First(); } } tvTree.EndUpdate(); tvTree.SelectedNode = newSelectedNode; if (newSelectedNode != null) { newSelectedNode.Expand(); } }
private void tvTree_DoubleClick(object sender, EventArgs e) { if (tvTree.SelectedNode != null && tcFiles.SelectedIndex > -1) { TreeNode selectedNode = tvTree.SelectedNode; if (selectedNode.Level > 0) { TreeNode parentNode = selectedNode.Parent; while (parentNode != null) { if (parentNode.Parent != null) { parentNode = parentNode.Parent; } else { break; } } if (parentNode != null) { EditorState editorState = (EditorState)parentNode.Tag; TabPage tab = (TabPage)editorState.Tag; tcFiles.SelectedTab = tab; tcFiles.Focus(); DoxygenNode entityNode = (DoxygenNode)selectedNode.Tag; editorState.GoToPosition(entityNode.Entity.StartRange.Index); } } } }
private void AddIssuesFromNode(IEnumerable <EditorState> states, EditorState state, IBaseNode rootNode, string fileName, string groupName) { if (typeof(CppNode).Equals(rootNode.GetType())) { CppNode cppNode = (CppNode)rootNode; CppEntity cppEntity = cppNode.Entity; if (cppEntity.DocumentationNode != null) { DoxygenNode doxyNode = (DoxygenNode)cppEntity.DocumentationNode; if (doxyNode.Entity.Kind == DoxygenEntityKind.BlockMulti) { DoxygenNode seeNode = doxyNode.TypedChildren.FirstOrDefault(c => c.Entity.Kind == DoxygenEntityKind.See) as DoxygenNode; bool hasDocumented = false; if (seeNode != null) { DoxygenNode refNode = seeNode.TypedChildren.FirstOrDefault(c => c.Entity.Kind == DoxygenEntityKind.Reference) as DoxygenNode; if (refNode != null) { hasDocumented = true; } } if (!hasDocumented) { AddIssue(lvCppIssues, new IssueTag(state, cppEntity.StartRange.Position), IssueType.Warning, "Not documented (Add a @see @ref [section or page id])", cppEntity.Id, cppEntity.Kind.ToString(), "C/C++", cppEntity.StartRange.Position.Line + 1, fileName); } } } } foreach (var child in rootNode.Children) { AddIssuesFromNode(states, state, child, fileName, "Child"); } }
private List <TreeNode> BuildSymbolTree(IBaseNode rootEntityNode, TreeNode rootTreeNode, IBaseNode selectedEntityNode) { List <TreeNode> result = new List <TreeNode>(); foreach (IBaseNode childEntityNode in rootEntityNode.Children) { if (typeof(DoxygenNode).Equals(childEntityNode.GetType())) { DoxygenNode doxyNode = (DoxygenNode)childEntityNode; DoxygenEntity entity = doxyNode.Entity; if (!AllowedDoxyEntities.Contains(entity.Kind)) { continue; } TreeNode parentNode; if (childEntityNode.ShowChildren) { parentNode = new TreeNode(entity.DisplayName); parentNode.Tag = childEntityNode; rootTreeNode.Nodes.Add(parentNode); if (selectedEntityNode != null) { if (selectedEntityNode.CompareTo(childEntityNode) == 0) { result.Add(parentNode); } } } else { parentNode = rootTreeNode; } result.AddRange(BuildSymbolTree(childEntityNode, parentNode, selectedEntityNode)); } } return(result); }