public void OnOpenDefault(object sender, RoutedEventArgs e) { if (!GetCommandActive()) { return; } var dte = Package.GetGlobalService(typeof(DTE)) as DTE2; if (dte != null) { Solution solution = dte.Solution; var solutionFile = solution.FileName; if (solutionFile != "") { var doxyFolder = System.IO.Path.GetDirectoryName(solutionFile) + "\\CodeGraphData"; CheckOrCreateFolder(doxyFolder); var doxyPath = doxyFolder + "\\Result_solution.graph"; if (File.Exists(doxyPath)) { if (DBManager.Instance().GetDB().IsOpen()) { DBManager.Instance().CloseDB(); } DBManager.Instance().OpenDB(doxyPath); UpdateUI(); } else { Logger.Warning(doxyPath + " doesn't exist. Please analyse solution first."); } } } }
DoxygenDB.EntitySearchResult SearchAndAddToScene( string name, int nameOption, string longName, int longNameOption, string type, string docPath, int lineNum) { searchWindow.nameEdit.Text = name; searchWindow.typeEdit.Text = type; searchWindow.fileEdit.Text = docPath; searchWindow.lineEdit.Text = lineNum.ToString(); searchWindow.resultList.Items.Clear(); var db = DBManager.Instance().GetDB(); var result = new DoxygenDB.EntitySearchResult(); if (db == null) { return(result); } var request = new DoxygenDB.EntitySearchRequest( name, nameOption, longName, longNameOption, type, docPath, lineNum); db.SearchAndFilter(request, out result); searchWindow.SetSearchResult(result); searchWindow.OnAddToScene(); return(result); }
public void OnOpen(object sender, RoutedEventArgs e) { if (!GetCommandActive()) { return; } Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog(); var dte = Package.GetGlobalService(typeof(DTE)) as DTE2; if (dte != null) { Solution solution = dte.Solution; var solutionFile = solution.FileName; if (solutionFile != "") { var doxyFolder = System.IO.Path.GetDirectoryName(solutionFile) + "\\CodeGraphData"; CheckOrCreateFolder(doxyFolder); ofd.InitialDirectory = doxyFolder; } } ofd.DefaultExt = ".graph"; ofd.Filter = "Code Graph Analysis Result|*.graph"; if (ofd.ShowDialog() == true) { if (DBManager.Instance().GetDB().IsOpen()) { DBManager.Instance().CloseDB(); } DBManager.Instance().OpenDB(ofd.FileName); UpdateUI(); } }
public void OnClose(object sender, RoutedEventArgs e) { if (!GetCommandActive()) { return; } DBManager.Instance().CloseDB(); UpdateUI(); UIManager.Instance().GetScene().m_selectTimeStamp += 1; }
public void GetDefinitionPosition(out string fileName, out int line, out int column) { fileName = ""; line = 0; column = 0; if (m_metric != null) { var metric = m_metric; if (metric.ContainsKey("file")) { fileName = metric["file"].m_string; line = metric["line"].m_int; column = metric["column"].m_int; } if (fileName == "" && metric.ContainsKey("declFile")) { fileName = metric["declFile"].m_string; line = metric["declLine"].m_int; column = metric["declColumn"].m_int; } } if (fileName == "") { var db = DBManager.Instance().GetDB(); if (db == null) { return; } var entity = db.SearchFromUniqueName(m_uniqueName); var refs = db.SearchRef(m_uniqueName, "definein"); if (refs.Count == 0) { refs = db.SearchRef(m_uniqueName, "declarein"); } if (refs.Count == 0) { refs = db.SearchRef(m_uniqueName, "callby"); } if (refs.Count == 0) { refs = db.SearchRef(m_uniqueName, "useby"); } if (refs.Count == 0) { return; } var refObj = refs[0]; var fileEnt = refObj.File(); fileName = fileEnt.Longname(); line = refObj.Line(); column = refObj.Column(); } }
public CursorNavigator() { var t0 = DateTime.Now; m_useCodeModel = !DBManager.Instance().IsBigSolution() && UIManager.Instance().GetMainUI().IsDynamicNavigation(); m_dte = Package.GetGlobalService(typeof(DTE)) as DTE2; var t1 = DateTime.Now; Logger.Debug("---CursorNavigator::CursorNavigator" + (t1 - t0).TotalMilliseconds.ToString()); }
private void TestButton_Click(object sender, RoutedEventArgs e) { // defaultPath = r"C:\Users\me\AppData\Roaming\Sublime Text 3\Packages\CodeAtlas\CodeAtlasSublime.udb" // defaultPath = "I:/Programs/masteringOpenCV/Chapter3_MarkerlessAR/doc/xml/index.xml" var defaultPath = "I:/Programs/mitsuba/Doxyfile"; //var defaultPath = "D:/Code/NewRapidRT/rapidrt/Doxyfile"; var newDownTime = DateTime.Now; DBManager.Instance().OpenDB(defaultPath); double duration = (DateTime.Now - newDownTime).TotalSeconds; Logger.Debug("open time:" + duration.ToString()); UpdateUI(); }
public void OnSearch() { var searchWord = nameEdit.Text; var searchKind = typeEdit.Text; var searchFile = fileEdit.Text.Replace("\\", "/"); int searchLine = Convert.ToInt32(lineEdit.Text == "" ? "-1" : lineEdit.Text); resultList.Items.Clear(); Logger.Debug("------------------- Search -----------------------"); var db = DBManager.Instance().GetDB(); if (db == null) { return; } var request = new DoxygenDB.EntitySearchRequest(searchWord, (int)DoxygenDB.SearchOption.DB_CONTAINS_WORD, "", 0, searchKind, searchFile, searchLine); var result = new DoxygenDB.EntitySearchResult(); db.SearchAndFilter(request, out result); SetSearchResult(result); }
public DoxygenDB.Entity GetEntity() { return(DBManager.Instance().GetDB().SearchFromUniqueName(m_uniqueName)); }
void CheckFindResultWindow(bool limitTime) { //var dte = Package.GetGlobalService(typeof(DTE)) as DTE2; //var win = dte.Windows.Item(EnvDTE.Constants.vsWindowKindFindResults1); //var selection = win.Selection as EnvDTE.TextSelection; //selection.SelectAll(); //var selectionText = selection.Text; //Logger.Debug("======================="); //Logger.Debug(selectionText); var dte = Package.GetGlobalService(typeof(DTE)) as DTE2; if (dte == null || m_srcUniqueName == "") { return; } var request = new DoxygenDB.EntitySearchRequest( "", (int)DoxygenDB.SearchOption.MATCH_WORD, "", (int)DoxygenDB.SearchOption.MATCH_WORD, "file", "", 0); var result = new DoxygenDB.EntitySearchResult(); var win = dte.Windows.Item(EnvDTE.Constants.vsWindowKindFindResults1); var selection = win.Selection as EnvDTE.TextSelection; selection.SelectAll(); var selectionText = selection.Text; var scene = UIManager.Instance().GetScene(); var db = DBManager.Instance().GetDB(); Point center; scene.GetSelectedCenter(out center); var rand = new Random(m_srcUniqueName.GetHashCode()); StringReader reader = new StringReader(selectionText); string strReadline; var beginTime = DateTime.Now; for (int ithLine = 0, processedLine = 0; (strReadline = reader.ReadLine()) != null; ++ithLine) { if (ithLine == 0) { continue; } if (m_processedLine.Contains(strReadline) || m_processedLine.Count > scene.GetLRUMaxLength()) { continue; } m_processedLine.Add(strReadline); int colon1Idx = strReadline.IndexOf(':'); if (colon1Idx == -1) { continue; } int colon2Idx = strReadline.IndexOf(':', colon1Idx + 1); if (colon2Idx == -1) { continue; } var pathLineColumn = strReadline.Substring(0, colon2Idx).Trim(); int lineBegin = pathLineColumn.LastIndexOf('('); int lineEnd = pathLineColumn.LastIndexOf(')'); if (lineBegin == -1 || lineEnd == -1) { continue; } var path = pathLineColumn.Substring(0, lineBegin); path = path.Replace('\\', '/'); int fileNameBegin = path.LastIndexOf('/'); if (fileNameBegin == -1) { continue; } var fileName = path.Substring(fileNameBegin + 1); var lineStr = pathLineColumn.Substring(lineBegin + 1, lineEnd - lineBegin - 1); int line; if (!int.TryParse(lineStr, out line)) { continue; } int column = strReadline.LastIndexOf(m_srcName); if (column == -1) { column = 0; } else { column -= colon2Idx; } request.m_shortName = fileName; request.m_longName = path; db.SearchAndFilter(request, out result); //if (result.bestEntity == null) //{ // continue; //} var bookmarkPos = new Point(center.X - 150, center.Y + (rand.NextDouble() - 0.5) * 200); var filePos = new Point(center.X - 300, center.Y + (rand.NextDouble() - 0.5) * 200); var uname = scene.GetBookmarkUniqueName(path, line, column); scene.AcquireLock(); scene.AddBookmarkItem(path, fileName, line, column, new Dictionary <string, object> { { "targetPos", bookmarkPos } }); scene.AddCodeItem(m_srcUniqueName, new Dictionary <string, object> { { "targetPos", center } }); scene.DoAddCustomEdge(uname, m_srcUniqueName); if (result.bestEntity != null) { var fileUname = result.bestEntity.UniqueName(); scene.AddCodeItem(fileUname, new Dictionary <string, object> { { "targetPos", filePos } }); scene.DoAddCustomEdge(fileUname, uname); } scene.ReleaseLock(); processedLine++; double duration = (DateTime.Now - beginTime).TotalMilliseconds; if (duration > 2000 && limitTime) { break; } } reader.Close(); }
bool _AnalyseSolution(bool useClang, bool onlySelectedProjects = false) { if (!GetCommandActive()) { return(false); } try { SetCommandActive(false); var traverser = new ProjectFileCollector(); if (onlySelectedProjects) { traverser.SetToSelectedProjects(); } var scene = UIManager.Instance().GetScene(); traverser.SetCustomExtension(scene.GetCustomExtensionDict()); traverser.Traverse(); var dirList = traverser.GetDirectoryList(); var solutionFolder = traverser.GetSolutionFolder(); if (dirList.Count == 0 || solutionFolder == "") { SetCommandActive(true); return(false); } string doxyFolder = solutionFolder + "/CodeGraphData"; CheckOrCreateFolder(doxyFolder); // Use selected projects as postfix string postFix = ""; if (onlySelectedProjects) { var projectNameList = traverser.GetSelectedProjectName(); foreach (string item in projectNameList) { postFix += "_" + item; } } else { postFix = "_solution"; } postFix = postFix.Replace(" ", ""); DoxygenDB.DoxygenDBConfig config = new DoxygenDB.DoxygenDBConfig(); config.m_configPath = doxyFolder + "/Result" + postFix + ".graph"; config.m_inputFolders = dirList; config.m_outputDirectory = doxyFolder + "/Result" + postFix; config.m_projectName = traverser.GetSolutionName() + postFix; config.m_includePaths = traverser.GetAllIncludePath(); config.m_defines = traverser.GetAllDefines(); config.m_useClang = useClang; config.m_mainLanguage = traverser.GetMainLanguage(); config.m_customExt = scene.GetCustomExtensionDict(); DBManager.Instance().CloseDB(); System.Threading.Thread analysisThread = new System.Threading.Thread((ThreadStart) delegate { try { if (DoxygenDB.DoxygenDB.GenerateDB(config)) { DBManager.Instance().OpenDB(config.m_configPath); } else { SetCommandActive(true); } } catch (Exception) { SetCommandActive(true); } }); analysisThread.Name = "Analysis Thread"; analysisThread.Start(); } catch (Exception) { Logger.Warning("Analyse failed. Please try again."); DBManager.Instance().CloseDB(); SetCommandActive(true); } return(true); }
bool ConnectTargetToSource() { // Get code element under cursor //Document doc = null; //doc = dte.ActiveDocument; //if (doc != null) //{ // EnvDTE.TextSelection ts = doc.Selection as EnvDTE.TextSelection; // int lineNum = ts.AnchorPoint.Line; // int lineOffset = ts.AnchorPoint.LineCharOffset; // ts.MoveToLineAndOffset(lineNum, lineOffset); //} // Get symbol name CodeElement tarElement; Document tarDocument; int tarLine; CursorNavigator.GetCursorElement(out tarDocument, out tarElement, out tarLine); if (tarElement == null) { Logger.Debug(" Go to source fail. No target element."); return(false); } // Search entity var tarName = tarElement.Name; var tarLongName = tarElement.FullName; var tarType = CursorNavigator.VSElementTypeToString(tarElement); var tarFile = tarDocument.FullName; var db = DBManager.Instance().GetDB(); var tarRequest = new DoxygenDB.EntitySearchRequest( tarName, (int)DoxygenDB.SearchOption.MATCH_CASE | (int)DoxygenDB.SearchOption.MATCH_WORD, tarLongName, (int)DoxygenDB.SearchOption.MATCH_CASE | (int)DoxygenDB.SearchOption.WORD_CONTAINS_DB | (int)DoxygenDB.SearchOption.DB_CONTAINS_WORD, tarType, tarFile, tarLine); var tarResult = new DoxygenDB.EntitySearchResult(); db.SearchAndFilter(tarRequest, out tarResult); if (tarResult.bestEntity == null) { tarRequest.m_longName = ""; db.SearchAndFilter(tarRequest, out tarResult); } // Connect custom edge bool res = false; if (tarResult.bestEntity != null) { var scene = UIManager.Instance().GetScene(); var targetEntity = tarResult.bestEntity; scene.AcquireLock(); scene.AddCodeItem(targetEntity.m_id); scene.AddCodeItem(m_srcUniqueName); res = scene.DoAddCustomEdge(targetEntity.m_id, m_srcUniqueName); scene.ReleaseLock(); Logger.Debug(" Add edge:" + res); } //var tarResult = DoShowInAtlas(); //if (tarResult != null && tarResult.bestEntity != null) //{ // targetEntityList.Add(tarResult.bestEntity); //} return(res); }
int CheckFiles() { var db = DBManager.Instance().GetDB(); var scene = UIManager.Instance().GetScene(); var beginTime = DateTime.Now; int count = 0; var request = new DoxygenDB.EntitySearchRequest( "", (int)DoxygenDB.SearchOption.MATCH_WORD, "", (int)DoxygenDB.SearchOption.MATCH_WORD, "file", "", 0); var result = new DoxygenDB.EntitySearchResult(); foreach (var item in m_referenceDict) { var value = item.Value; if (value.m_isCheck) { continue; } value.m_isCheck = true; string itemInfo = item.Key; int pathSplitPos = itemInfo.IndexOf("("); if (pathSplitPos == -1) { continue; } string fileName = itemInfo.Substring(0, pathSplitPos); request.m_shortName = fileName; db.SearchAndFilter(request, out result); if (result.bestEntity == null) { continue; } string path = result.bestEntity.Longname(); int commaSplitPos = itemInfo.IndexOf(", ", pathSplitPos); if (commaSplitPos == -1) { continue; } int lineStartPos = pathSplitPos + 1; string lineStr = itemInfo.Substring(lineStartPos, commaSplitPos - lineStartPos); int columnEndPos = itemInfo.IndexOf(")"); int columnStartPos = commaSplitPos + 2; string columnStr = itemInfo.Substring(columnStartPos, columnEndPos - columnStartPos); int line; int column; if (int.TryParse(lineStr, out line) && int.TryParse(columnStr, out column)) { //if (!GoToDocument(path, line, column)) // continue; //ConnectTargetToSource(); var uname = scene.GetBookmarkUniqueName(path, line, column); scene.AddBookmarkItem(path, fileName, line, column); scene.AddCodeItem(m_srcUniqueName); scene.AcquireLock(); scene.DoAddCustomEdge(uname, m_srcUniqueName); scene.ReleaseLock(); } count++; var duration = (DateTime.Now - beginTime).TotalMilliseconds; if (duration > 100) { break; } } return(count); }
void ProcessReferenceList(out bool isComplete) { isComplete = false; var db = DBManager.Instance().GetDB(); var objectList = m_searchResultList as IVsObjectList2; var dte = Package.GetGlobalService(typeof(DTE)) as DTE2; if (objectList == null || dte == null) { return; } try { uint pCount; bool isProcessing = false; List <DoxygenDB.Entity> targetEntityList = new List <DoxygenDB.Entity>(); if (objectList.GetItemCount(out pCount) != VSConstants.S_OK) { isProcessing = true; return; } var beginTime = DateTime.Now; ushort img; bool isDoing; string itemText; bool longNameMatched = false; for (uint i = 0; i < pCount; i++) { GetListItemInfo(objectList, i, out itemText, out img, out isDoing); if (itemText.Contains(m_srcLongName)) { longNameMatched = true; } } for (uint i = 0; i < pCount; i++) { GetListItemInfo(objectList, i, out itemText, out img, out isDoing); Logger.Debug("+++++++" + itemText); if (longNameMatched && !itemText.Contains(m_srcLongName)) { continue; } isProcessing |= isDoing; if (isDoing) { continue; } if (m_itemDict.ContainsKey(itemText)) { continue; } IVsObjectList2 subList; bool isItemProcessing = false; uint flags; objectList.GetFlags(out flags); // _VSTREEFLAGS uint counter, changes; objectList.UpdateCounter(out counter, out changes); // _VSTREEITEMCHANGESMASK uint cap; objectList.GetCapabilities2(out cap); // _LIB_LISTCAPABILITIES if (objectList.GetList2(i, (uint)_LIB_LISTTYPE.LLT_REFERENCES, (uint)(_LIB_LISTFLAGS.LLF_NONE), new VSOBSEARCHCRITERIA2[0], out subList) == VSConstants.S_OK && subList != null) { // Switch to using our "safe" PInvoke interface for IVsObjectList2 to avoid potential memory management issues // when receiving strings as out params. uint list2ItemCount = 0; if (subList.GetItemCount(out list2ItemCount) != VSConstants.S_OK) { isItemProcessing = true; continue; } //Logger.Debug(" sublist: " + i + " count: " + list2ItemCount); for (uint j = 0; j < list2ItemCount; j++) { string text; GetListItemInfo(subList, j, out text, out img, out isDoing); isItemProcessing |= isDoing; if (isDoing) { continue; } // Ignore several reference types // 12: comment bool isIgnored = (img == 12 || img == 17); Logger.Debug("Type:" + img + ": " + !isIgnored + ": " + text); if (isIgnored) { continue; } if (!m_referenceDict.ContainsKey(text)) { m_referenceDict[text] = new RefStatus(img); } var refItem = m_referenceDict[text]; if (refItem.m_isCheck) { continue; } //int isOK; //int res = subList.CanGoToSource(j, VSOBJGOTOSRCTYPE.GS_REFERENCE, out isOK); //if (res != VSConstants.S_OK || isOK == 0) //{ // isItemProcessing = true; // continue; //} //if (subList.GoToSource(j, VSOBJGOTOSRCTYPE.GS_REFERENCE) != VSConstants.S_OK) //{ // Logger.Debug("Go to source failed. " + text); // isItemProcessing = true; // continue; //} //refItem.m_isCheck = ConnectTargetToSource(); var duration = (DateTime.Now - beginTime).TotalMilliseconds; //if (duration > 500) //{ // isItemProcessing = true; // return; //} } } if (!isItemProcessing) { m_itemDict[itemText] = ""; } isProcessing |= isItemProcessing; } if (!isProcessing) { isComplete = true; // No more item } Logger.Debug("========================================="); } catch (InvalidCastException) { // fixed in VS2010 // VSBug : trying to cast IVsObjectList2 to IVsObjectList, shows 'Find Results' pane, but pplist is null } }
public void OnShowDefinitionInAtlas(object sender, ExecutedRoutedEventArgs e) { var scene = UIManager.Instance().GetScene(); CodeElement srcElement, tarElement; Document srcDocument, tarDocument; int srcLine, tarLine; CursorNavigator.GetCursorElement(out srcDocument, out srcElement, out srcLine); Guid cmdGroup = VSConstants.GUID_VSStandardCommandSet97; var commandTarget = ((System.IServiceProvider)m_package).GetService(typeof(SUIHostCommandDispatcher)) as IOleCommandTarget; if (commandTarget != null) { int hr = commandTarget.Exec(ref cmdGroup, (uint)VSConstants.VSStd97CmdID.GotoDefn, (uint)OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT, System.IntPtr.Zero, System.IntPtr.Zero); } CursorNavigator.GetCursorElement(out tarDocument, out tarElement, out tarLine); if (srcElement == null || tarElement == null || srcElement == tarElement) { return; } var srcName = srcElement.Name; var srcLongName = srcElement.FullName; var srcType = CursorNavigator.VSElementTypeToString(srcElement); var srcFile = srcDocument.FullName; var tarName = tarElement.Name; var tarLongName = tarElement.FullName; var tarType = CursorNavigator.VSElementTypeToString(tarElement); var tarFile = tarDocument.FullName; var db = DBManager.Instance().GetDB(); var srcRequest = new DoxygenDB.EntitySearchRequest( srcName, (int)DoxygenDB.SearchOption.MATCH_CASE | (int)DoxygenDB.SearchOption.MATCH_WORD, srcLongName, (int)DoxygenDB.SearchOption.MATCH_CASE | (int)DoxygenDB.SearchOption.DB_CONTAINS_WORD, srcType, srcFile, srcLine); var srcResult = new DoxygenDB.EntitySearchResult(); db.SearchAndFilter(srcRequest, out srcResult); //var tarRequest = new DoxygenDB.EntitySearchRequest( // tarName, (int)DoxygenDB.SearchOption.MATCH_CASE | (int)DoxygenDB.SearchOption.MATCH_WORD, // tarLongName, (int)DoxygenDB.SearchOption.MATCH_CASE | (int)DoxygenDB.SearchOption.DB_CONTAINS_WORD, // tarType, tarFile, tarLine); //var tarResult = new DoxygenDB.EntitySearchResult(); //db.SearchAndFilter(tarRequest, out tarResult); var tarResult = DoShowInAtlas(); DoxygenDB.Entity srcBestEntity, tarBestEntity; srcBestEntity = srcResult.bestEntity; tarBestEntity = tarResult.bestEntity; if (srcBestEntity != null && tarBestEntity != null && srcBestEntity.m_id != tarBestEntity.m_id) { scene.AcquireLock(); scene.AddCodeItem(srcBestEntity.m_id); scene.AddCodeItem(tarBestEntity.m_id); scene.DoAddCustomEdge(srcBestEntity.m_id, tarBestEntity.m_id); scene.SelectCodeItem(tarBestEntity.m_id); scene.ReleaseLock(); } else if (tarBestEntity != null && scene.m_customEdgeSource != null && scene.m_customEdgeSource != "") { scene.AcquireLock(); scene.DoAddCustomEdge(scene.m_customEdgeSource, tarBestEntity.m_id); scene.CancelCustomEdgeMode(); scene.SelectCodeItem(tarBestEntity.m_id); scene.ReleaseLock(); } }
bool _AnalyseSolution(bool useClang, AnalyseType type = AnalyseType.ANALYSE_SOLUTION) { if (!GetCommandActive()) { return(false); } try { Logger.Info("Analysis Begin."); SetCommandActive(false); var traverser = new ProjectFileCollector(); if (type == AnalyseType.ANALYSE_SELECTED_PROJECTS) { traverser.SetToSelectedProjects(); } if (type == AnalyseType.ANALYSE_OPENED_FILES) { traverser.SetIncludeScope(ProjectFileCollector.IncludeScope.INCLUDE_OPEN_FOLDERS); } else { traverser.SetIncludeScope(ProjectFileCollector.IncludeScope.INCLUDE_PROJECT_FOLDERS); } var scene = UIManager.Instance().GetScene(); traverser.SetCustomExtension(scene.GetCustomExtensionDict()); traverser.SetCustomMacro(scene.GetCustomMacroSet()); traverser.Traverse(); var dirList = traverser.GetDirectoryList(); var solutionFolder = traverser.GetSolutionFolder(); if ((type == AnalyseType.ANALYSE_DUMMY && dirList.Count == 0) || solutionFolder == "") { SetCommandActive(true); return(false); } string doxyFolder = solutionFolder; if (analysisWindow.customDirectoryEdit.Text != null && analysisWindow.customDirectoryEdit.Text != "") { doxyFolder = analysisWindow.customDirectoryEdit.Text; } doxyFolder += "/CodeGraphData"; CheckOrCreateFolder(doxyFolder); Logger.Info("Folder: " + doxyFolder); // Use selected projects as postfix string postFix = ""; if (type == AnalyseType.ANALYSE_SELECTED_PROJECTS) { var projectNameList = traverser.GetSelectedProjectName(); foreach (string item in projectNameList) { postFix += "_" + item; } } else if (type == AnalyseType.ANALYSE_DUMMY) { postFix = "_dummy"; } else if (type == AnalyseType.ANALYSE_OPENED_FILES) { postFix = "_files"; } else { postFix = "_solution"; } postFix = postFix.Replace(" ", ""); DoxygenDB.DoxygenDBConfig config = new DoxygenDB.DoxygenDBConfig(); config.m_configPath = doxyFolder + "/Result" + postFix + ".graph"; if (type != AnalyseType.ANALYSE_DUMMY) { config.m_inputFolders = dirList; config.m_includePaths = traverser.GetAllIncludePath(); } config.m_outputDirectory = doxyFolder + "/Result" + postFix; config.m_projectName = traverser.GetSolutionName() + postFix; config.m_defines = traverser.GetAllDefines(); config.m_useClang = useClang; config.m_mainLanguage = traverser.GetMainLanguage(); config.m_customExt = scene.GetCustomExtensionDict(); DBManager.Instance().CloseDB(); System.Threading.Thread analysisThread = new System.Threading.Thread((ThreadStart) delegate { try { if (DoxygenDB.DoxygenDB.GenerateDB(config)) { DBManager.Instance().OpenDB(config.m_configPath); } else { SetCommandActive(true); } } catch (Exception) { SetCommandActive(true); } }); analysisThread.Name = "Analysis Thread"; analysisThread.Start(); } catch (Exception) { Logger.Warning("Analyse failed. Please try again."); DBManager.Instance().CloseDB(); SetCommandActive(true); } return(true); }
static bool UseCodeModel() { return(!DBManager.Instance().IsBigSolution() && UIManager.Instance().GetMainUI().IsDynamicNavigation()); }