Ejemplo 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;
 }
Ejemplo n.º 3
0
 public LoadSceneAnalyzer([NotNull] UnityApi unityApi, AssetSerializationMode assetSerializationMode,
                          UnityYamlSupport unityYamlSupport)
     : base(unityApi)
 {
     myAssetSerializationMode = assetSerializationMode;
     myUnityYamlSupport       = unityYamlSupport;
 }
Ejemplo n.º 4
0
        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;
 }
Ejemplo 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;
 }
Ejemplo 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;
 }
Ejemplo 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)));
        }
Ejemplo 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;
 }
Ejemplo 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)
 {
 }