Example #1
0
        public bool SolutionAnalysisHasNoErrors()
        {
            bool hasErrors = false;

            _threading.Run("TestRunner", ActivateSolutionAnalysis);
            resharper::JetBrains.Threading.JetDispatcher.Run(() => !_solutionManager.AnalysisComplete, TimeSpan.MaxValue, true);
            var sw = Stopwatch.StartNew();

            do
            {
                _threading.Run("Rerun failed tests",
                               () =>
                {
#if v450
                    var action = _actionManager.GetAction(PluginManager.ACTION_REANALYZE);
#elif !v600
                    var action = _actionManager.GetUpdatableAction(PluginManager.ACTION_REANALYZE);
#else
                    var action = _actionManager.TryGetAction(PluginManager.ACTION_REANALYZE);
#endif

                    hasErrors = _actionManager.UpdateAction((ResharperUpdatableAction)action);
                    if (hasErrors)
                    {
                        _solutionManager.ReanalyzeAll();
                    }
                });
                if (hasErrors)
                {
                    resharper::JetBrains.Threading.JetDispatcher.Run(() => !_solutionManager.AnalysisComplete, TimeSpan.MaxValue, true);
                }
            } while (hasErrors && CanContinueWaiting(sw, TimeSpan.FromSeconds(60)));
            return(!hasErrors);
        }
        void LoadAssemblies()
        {
            while (!_shuttingDown)
            {
                EventWaitHandle wait = null;
                try
                {
                    wait = EventWaitHandle.OpenExisting(System.Diagnostics.Process.GetCurrentProcess().Id + ASSEMBLY_NOTIFY);
                }
                catch
                {
                }
                if (wait == null)
                {
                    System.Threading.Thread.Sleep(TimeSpan.FromSeconds(1));
                    continue;
                }

                WaitHandle.WaitAny(new WaitHandle[] { wait, _shutdownSync });
                if (_shuttingDown)
                {
                    return;
                }
                _assemblyMap = (Dictionary <string, List <string> >)AppDomain.CurrentDomain.GetData(ASSEMBLY_DATA);
                _threading.Run("Updating references.", RefreshProjects);
            }
        }
Example #3
0
        public PluginManager()
        {
            _dte    = (DTE2)SiteManager.GetGlobalService <DTE>();
            _output = new OpenWrapOutput("Resharper Plugin Manager");
            _output.Write("Loaded ({0}).", GetType().Assembly.GetName().Version);

#if !v600
            _threading = new LegacyShellThreading();
#else
            _host = resharper::JetBrains.VsIntegration.Application.JetVisualStudioHost.GetOrCreateHost((Microsoft.VisualStudio.OLE.Interop.IServiceProvider)_dte);
            var resolvedObj = _host.Environment.Container.ResolveDynamic(typeof(ResharperThreading));
            if (resolvedObj != null)
            {
                _threading = (ResharperThreading)resolvedObj.Instance;
            }
#endif
            if (_threading == null)
            {
                _output.Write("Threading not found, the plugin manager will not initialize.");
                return;
            }
            _threading.Run("Loading plugins...", StartDetection);
        }