Esempio n. 1
0
        public UnityYamlDisableStrategy(Lifetime lifetime, ISolution solution, ISettingsStore settingsStore, UnityYamlSupport unityYamlSupport)
        {
            myUnityYamlSupport = unityYamlSupport;
            var boundStore = settingsStore.BindToContextLive(lifetime, ContextRange.ManuallyRestrictWritesToOneContext(solution.ToDataContext()));

            myShouldRunHeuristic = boundStore.GetValueProperty(lifetime, (UnitySettings s) => s.ShouldApplyYamlHugeFileHeuristic);
        }
 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 LoadSceneAnalyzer([NotNull] UnityApi unityApi, AssetSerializationMode assetSerializationMode,
                          UnityYamlSupport unityYamlSupport)
     : base(unityApi)
 {
     myAssetSerializationMode = assetSerializationMode;
     myUnityYamlSupport       = unityYamlSupport;
 }
        public UnityCacheUpdater(Lifetime lifetime, ISolution solution, UnityYamlSupport unityYamlSupport, IShellLocks locks, ChangeManager changeManager, UnityExternalFilesModuleFactory factory)
        {
            var module = factory.PsiModule;

            if (module != null)
            {
                unityYamlSupport.IsUnityYamlParsingEnabled.Change.Advise_NoAcknowledgement(lifetime, (handler) =>
                {
                    if (handler.HasNew && handler.HasOld && handler.New == handler.Old)
                    {
                        return;
                    }

                    locks.ExecuteOrQueueReadLockEx(lifetime, "YamlParsingStateChange", () =>
                    {
                        var psiSourceFiles = module.SourceFiles.ToList();
                        if (psiSourceFiles.Any())
                        {
                            locks.ExecuteWithWriteLock(() => changeManager.ExecuteAfterChange(() =>
                            {
                                var changeBuilder = new PsiModuleChangeBuilder();
                                foreach (var sourceFile in psiSourceFiles)
                                {
                                    if (sourceFile.IsValid())
                                    {
                                        changeBuilder.AddFileChange(sourceFile, PsiModuleChange.ChangeType.Modified);
                                    }
                                }
                                changeManager.OnProviderChanged(solution, changeBuilder.Result, SimpleTaskExecutor.Instance);
                            }));
                        }
                    });
                });
            }
        }
 public CompareTagProblemAnalyzer(UnityApi unityApi, AssetSerializationMode assetSerializationMode,
                                  UnityYamlSupport unityYamlSupport)
     : base(unityApi)
 {
     myAssetSerializationMode = assetSerializationMode;
     myUnityYamlSupport       = unityYamlSupport;
 }
 public UnityExternalFileProperties(IPsiSourceFile sourceFile, UnityYamlSupport unityYamlSupport,
                                    BinaryUnityFileCache binaryUnityFileCache)
 {
     mySourceFile           = sourceFile;
     myUnityYamlSupport     = unityYamlSupport;
     myBinaryUnityFileCache = binaryUnityFileCache;
 }
Esempio n. 7
0
        public RiderUnityYamlDisableStrategy(Lifetime lifetime, ISolution solution, ISettingsStore settingsStore,
                                             UnityYamlSupport unityYamlSupport, UnityHost unityHost)
            : base(lifetime, solution, settingsStore, unityYamlSupport)
        {
            myUnityHost = unityHost;

            myUnityHost.PerformModelAction(t =>
                                           t.EnableYamlParsing.Advise(lifetime, _ => unityYamlSupport.IsUnityYamlParsingEnabled.Value = true));
        }
 public UnityYamlPsiSourceFileFactory(IProjectFileExtensions projectFileExtensions,
                                      PsiProjectFileTypeCoordinator projectFileTypeCoordinator,
                                      UnityYamlSupport unityYamlSupport,
                                      DocumentManager documentManager)
 {
     myProjectFileExtensions      = projectFileExtensions;
     myProjectFileTypeCoordinator = projectFileTypeCoordinator;
     myUnityYamlSupport           = unityYamlSupport;
     myDocumentManager            = documentManager;
 }
Esempio n. 9
0
 public RiderTypeDetector(ISolution solution, SolutionAnalysisService swa, CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                          SettingsStore settingsStore, PerformanceCriticalCodeCallGraphAnalyzer analyzer, UnityApi unityApi,
                          UnityCodeInsightProvider codeInsightProvider,
                          UnitySolutionTracker solutionTracker, ConnectionTracker connectionTracker,
                          IconHost iconHost, UnityYamlSupport unityYamlSupport, AssetSerializationMode assetSerializationMode)
     : base(solution, swa, callGraphSwaExtensionProvider, settingsStore, unityApi, analyzer)
 {
     myCodeInsightProvider    = codeInsightProvider;
     mySolutionTracker        = solutionTracker;
     myConnectionTracker      = connectionTracker;
     myIconHost               = iconHost;
     myUnityYamlSupport       = unityYamlSupport;
     myAssetSerializationMode = assetSerializationMode;
 }
Esempio n. 10
0
        public UnityExternalFilesModuleProcessor(Lifetime lifetime, ILogger logger, ISolution solution,
                                                 ChangeManager changeManager,
                                                 IShellLocks locks,
                                                 ISolutionLoadTasksScheduler scheduler,
                                                 IFileSystemTracker fileSystemTracker,
                                                 ProjectFilePropertiesFactory projectFilePropertiesFactory,
                                                 UnityYamlPsiSourceFileFactory psiSourceFileFactory,
                                                 UnityExternalFilesModuleFactory moduleFactory,
                                                 UnityYamlDisableStrategy unityYamlDisableStrategy,
                                                 BinaryUnityFileCache binaryUnityFileCache,
                                                 ISettingsSchema settingsSchema,
                                                 SettingsLayersProvider settingsLayersProvider,
                                                 AssetSerializationMode assetSerializationMode,
                                                 UnityYamlSupport unityYamlSupport)
        {
            myLifetime                     = lifetime;
            myLogger                       = logger;
            mySolution                     = solution;
            myChangeManager                = changeManager;
            myLocks                        = locks;
            myFileSystemTracker            = fileSystemTracker;
            myProjectFilePropertiesFactory = projectFilePropertiesFactory;
            myPsiSourceFileFactory         = psiSourceFileFactory;
            myModuleFactory                = moduleFactory;
            myUnityYamlDisableStrategy     = unityYamlDisableStrategy;
            myBinaryUnityFileCache         = binaryUnityFileCache;
            mySettingsSchema               = settingsSchema;
            mySettingsLayersProvider       = settingsLayersProvider;
            myAssetSerializationMode       = assetSerializationMode;
            myUnityYamlSupport             = unityYamlSupport;

            changeManager.RegisterChangeProvider(lifetime, this);

            myRootPaths = new JetHashSet <FileSystemPath>();

            // SolutionDirectory isn't absolute in tests, and will throw an exception if we use it when we call Exists
            mySolutionDirectory = solution.SolutionDirectory;
            if (!mySolutionDirectory.IsAbsolute)
            {
                mySolutionDirectory = solution.SolutionDirectory.ToAbsolutePath(FileSystemUtil.GetCurrentDirectory());
            }

            scheduler.EnqueueTask(new SolutionLoadTask(GetType().Name + ".Activate",
                                                       SolutionLoadTaskKinds.PreparePsiModules,
                                                       () => myChangeManager.AddDependency(myLifetime, mySolution.PsiModules(), this)));
        }
Esempio n. 11
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 UnityYamlFileSizeLogContributor(UnitySolutionTracker unitySolutionTracker, UnityYamlSupport unityYamlSupport, UnityExternalFilesModuleProcessor moduleProcessor)
 {
     myUnitySolutionTracker = unitySolutionTracker;
     myUnityYamlSupport     = unityYamlSupport;
     myModuleProcessor      = moduleProcessor;
 }
Esempio n. 13
0
 public TestUnityExternalFilesModuleProcessor(Lifetime lifetime, ILogger logger, ISolution solution, ChangeManager changeManager, IShellLocks locks, ISolutionLoadTasksScheduler scheduler, IFileSystemTracker fileSystemTracker, ProjectFilePropertiesFactory projectFilePropertiesFactory, UnityYamlPsiSourceFileFactory psiSourceFileFactory, UnityExternalFilesModuleFactory moduleFactory, UnityYamlDisableStrategy unityYamlDisableStrategy, BinaryUnityFileCache binaryUnityFileCache, ISettingsSchema settingsSchema, SettingsLayersProvider settingsLayersProvider, AssetSerializationMode assetSerializationMode, UnityYamlSupport unityYamlSupport)
     : base(lifetime, logger, solution, changeManager, locks, scheduler, fileSystemTracker, projectFilePropertiesFactory, psiSourceFileFactory, moduleFactory, unityYamlDisableStrategy, binaryUnityFileCache, settingsSchema, settingsLayersProvider, assetSerializationMode, unityYamlSupport)
 {
 }