public RiderUnityYamlDisableStrategy(Lifetime lifetime, ISolution solution, SolutionCaches solutionCaches, ISettingsStore settingsStore,
                                             UnityYamlSupport unityYamlSupport, UnityHost unityHost)
            : base(lifetime, solution, solutionCaches, settingsStore, unityYamlSupport)
        {
            myUnityHost = unityHost;

            myUnityHost.PerformModelAction(t =>
                                           t.EnableYamlParsing.Advise(lifetime, _ => unityYamlSupport.IsUnityYamlParsingEnabled.Value = true));
        }
Пример #2
0
        public RiderUnityYamlDisableStrategy(Lifetime lifetime, ISolution solution, SolutionCaches solutionCaches,
                                             IApplicationWideContextBoundSettingStore settingsStore,
                                             AssetIndexingSupport assetIndexingSupport, FrontendBackendHost frontendBackendHost)
            : base(lifetime, solution, solutionCaches, settingsStore, assetIndexingSupport)
        {
            myFrontendBackendHost = frontendBackendHost;

            myFrontendBackendHost.Do(t =>
                                     t.EnableYamlParsing.Advise(lifetime, _ => assetIndexingSupport.IsEnabled.Value = true));
        }
Пример #3
0
        public UnityYamlDisableStrategy(Lifetime lifetime, ISolution solution, SolutionCaches solutionCaches, ISettingsStore settingsStore, UnityYamlSupport unityYamlSupport)
        {
            mySolutionCaches   = solutionCaches;
            myUnityYamlSupport = unityYamlSupport;
            var boundStore = settingsStore.BindToContextLive(lifetime, ContextRange.ManuallyRestrictWritesToOneContext(solution.ToDataContext()));
            var oldValue   = boundStore.GetValue((UnitySettings s) => s.ShouldApplyYamlHugeFileHeuristic);

            if (!oldValue)
            {
                mySolutionCaches.PersistentProperties[SolutionCachesId] = false.ToString();
            }

            if (mySolutionCaches.PersistentProperties.TryGetValue(SolutionCachesId, out var result))
            {
                myShouldRunHeuristic = Boolean.Parse(result);
            }
            else
            {
                myShouldRunHeuristic = true;
            }
        }
        public DeferredCacheController(Lifetime lifetime, ISolution solution, SolutionCaches solutionCaches,
                                       ISolutionLoadTasksScheduler tasksScheduler, IPersistentIndexManager persistentIndexManager, IPsiFiles psiFiles,
                                       SolutionAnalysisConfiguration solutionAnalysisConfiguration, IShellLocks shellLocks,
                                       DeferredHelperCache deferredHelperCache, IEnumerable <IDeferredCache> deferredCaches,
                                       DeferredCacheProgressBar progressBar, ILogger logger)
        {
            myLifetime       = lifetime;
            mySolution       = solution;
            mySolutionCaches = solutionCaches;
            myPsiFiles       = psiFiles;
            mySolutionAnalysisConfiguration = solutionAnalysisConfiguration;
            myShellLocks          = shellLocks;
            myDeferredHelperCache = deferredHelperCache;
            myDeferredCaches      = deferredCaches;
            myProgressBar         = progressBar;
            myLogger = logger;
            var defaultValue = solutionCaches.PersistentProperties.TryGetValue("DeferredCachesCompletedOnce", out var result) && result.Equals("True");

            myCompletedOnce = new ViewableProperty <bool>(defaultValue);

            myGroupingEvent = solution.Locks.GroupingEvents.CreateEvent(lifetime, "DeferredCachesCoreActivity", TimeSpan.FromMilliseconds(500), Rgc.Guarded, RunBackgroundActivity);
        }
Пример #5
0
        public UnityYamlSupport(Lifetime lifetime, YamlSupport yamlSupport, SolutionCaches solutionCaches, ISolution solution, ISettingsStore settingsStore)
        {
            var settings = settingsStore.BindToContextLive(lifetime,
                                                           ContextRange.ManuallyRestrictWritesToOneContext(solution.ToDataContext()));

            IsUnityYamlParsingEnabled = settings.GetValueProperty(lifetime, (UnitySettings key) => key.IsYamlParsingEnabled);

            if (!yamlSupport.IsParsingEnabled.Value)
            {
                IsUnityYamlParsingEnabled.Value = false;
            }

            IsUnityYamlParsingEnabled.Change.Advise(lifetime, v =>
            {
                if (v.HasNew && v.New)
                {
                    yamlSupport.IsParsingEnabled.Value = true;
                    if (v.HasOld)
                    {
                        solutionCaches.PersistentProperties[UnityYamlDisableStrategy.SolutionCachesId] = false.ToString();
                    }
                }
            });
        }
 public CgIncludeDirectoryTracker(Lifetime lifetime, UnityReferencesTracker unityReferencesTracker,
                                  SolutionCaches solutionCaches, IShellLocks shellLocks, ISolutionLoadTasksScheduler scheduler,
                                  CppGlobalCacheImpl cppGlobalCache, UnityVersion unityVersion, ILogger logger)
 {
     scheduler.EnqueueTask(new SolutionLoadTask("InitCgIncludeDirectoryTracker", SolutionLoadTaskKinds.PreparePsiModules,
                                                () =>
     {
         unityReferencesTracker.HasUnityReference.AdviseOnce(lifetime, _ =>
         {
             if (solutionCaches.PersistentProperties.TryGetValue(CG_INCLUDE_DIRECTORY_PATH, out var result))
             {
                 var oldPath = FileSystemPath.TryParse(result, FileSystemPathInternStrategy.INTERN);
                 var newPath = GetCgIncludeFolderPath(unityVersion);
                 if (!oldPath.Equals(newPath))
                 {
                     cppGlobalCache.IsCacheStarted.Change.Advise(lifetime, v =>
                     {
                         if (v.HasNew && v.New)
                         {
                             shellLocks.Tasks.StartNew(lifetime, Scheduling.MainGuard, TaskPriority.High, () =>
                             {
                                 logger.Verbose("Dropping C++ cache, because Unity version is changed");
                                 cppGlobalCache.ResetCache();
                                 solutionCaches.PersistentProperties[CG_INCLUDE_DIRECTORY_PATH] = newPath.FullPath;
                             });
                         }
                     });
                 }
             }
             else
             {
                 solutionCaches.PersistentProperties[CG_INCLUDE_DIRECTORY_PATH] = GetCgIncludeFolderPath(unityVersion).FullPath;
             }
         });
     }));
 }
        public AssetIndexingSupport(Lifetime lifetime, YamlSupport yamlSupport, SolutionCaches solutionCaches,
                                    ISolution solution, SolutionWideWritableContextBoundSettingsStore settingsStore)
        {
            IsEnabled = settingsStore.BoundSettingsStore.GetValueProperty(lifetime,
                                                                          (UnitySettings key) => key.IsAssetIndexingEnabled);

            if (!yamlSupport.IsParsingEnabled.Value)
            {
                IsEnabled.Value = false;
            }

            IsEnabled.Change.Advise(lifetime, v =>
            {
                if (v.HasNew && v.New)
                {
                    yamlSupport.IsParsingEnabled.Value = true;
                    if (v.HasOld)
                    {
                        solutionCaches.PersistentProperties[UnityYamlDisableStrategy.SolutionCachesId] =
                            false.ToString();
                    }
                }
            });
        }
 public ReSharperUnityYamlDisableStrategy(Lifetime lifetime, ISolution solution, SolutionCaches solutionCaches, ISettingsStore settingsStore,
                                          UnityYamlSupport unityYamlSupport, UserNotifications notifications)
     : base(lifetime, solution, solutionCaches, settingsStore, unityYamlSupport)
 {
     myLifetime      = lifetime;
     myNotifications = notifications;
 }
 public ReSharperUnityYamlDisableStrategy(Lifetime lifetime, ISolution solution, SolutionCaches solutionCaches,
                                          IApplicationWideContextBoundSettingStore settingsStore,
                                          AssetIndexingSupport assetIndexingSupport,
                                          UserNotifications notifications)
     : base(lifetime, solution, solutionCaches, settingsStore, assetIndexingSupport)
 {
     myLifetime      = lifetime;
     myNotifications = notifications;
 }