public void UpdateTree(string fileName, bool ignoreCache = false) { var codeProvider = new NppCodeProvider(fileName); var result = _jsParserService.Process(codeProvider, ignoreCache); if (result == null) { //not JS case _jsParserService.InvalidateCash(); if (_frmParserUiContainer != null) { _frmParserUiContainer.navigationTreeView1.Clear(); } return; } if (!result.IsEmpty) { if (_frmParserUiContainer != null) { _frmParserUiContainer.navigationTreeView1.UpdateTree(result, codeProvider); } } }
public void CallParserForDocument(ICodeProvider codeProvider) { _activeDocFullName = codeProvider.FullName; var result = _jsParserService.Process(codeProvider); var toolWindow = _findWindowDelegate(); if (result == null) { // Not JS case - need to clean tree _jsParserService.InvalidateCash(); if (toolWindow != null) { toolWindow.NavigationTreeView.Clear(); } return; } if (string.IsNullOrEmpty(result.FileName)) { // skip - cached result return; } JsParserEventsBroadcaster.FireActionsForDoc( _activeDocFullName, new JsParserErrorsNotificationArgs { Code = codeProvider, FullFileName = _activeDocFullName, Errors = result.Errors }); if (toolWindow != null) { NotifyColorChangeToToolWindow(); toolWindow.NavigationTreeView.UpdateTree(result, codeProvider); } }