Пример #1
0
        public UnityReferencesTracker(
            Lifetime lifetime,
            IEnumerable <IUnityReferenceChangeHandler> handlers,
            ISolution solution,
            ISolutionLoadTasksScheduler scheduler,
            ModuleReferenceResolveSync moduleReferenceResolveSync,
            ChangeManager changeManager,
            IViewableProjectsCollection projects,
            ILogger logger)
        {
            myAllProjectLifetimes = new Dictionary <IProject, Lifetime>();
            myUnityProjects       = new HashSet <IProject>();

            myHandlers = handlers.ToList();
            myLifetime = lifetime;
            myLogger   = logger;
            mySolution = solution;
            myModuleReferenceResolveSync = moduleReferenceResolveSync;
            myChangeManager = changeManager;
            myProjects      = projects;

            // At PreparePsiModules, we know what references we have, so we know if we're a Unity project. This is where
            // we'll initialise our custom PSI module. We have to initialise our PSI module before Done, or the
            // PersistentIndexManager will clean out the "orphaned" external (YAML) files and we'll have to reparse all
            // files on every startup
            scheduler.EnqueueTask(new SolutionLoadTask("Preparing Unity project", SolutionLoadTaskKinds.PreparePsiModules,
                                                       OnSolutionPreparePsiModules));
        }
        public UnityReferencesTracker(
            Lifetime lifetime,

            IEnumerable <IHandler> handlers,
            ISolution solution,

            ISolutionLoadTasksScheduler scheduler,
            IShellLocks shellLocks,

            ModuleReferenceResolveSync moduleReferenceResolveSync,
            ChangeManager changeManager,
            IViewableProjectsCollection projects,
            ILogger logger
            )
        {
            myProjectLifetimes = new Dictionary <IProject, Lifetime>();

            myHandlers   = handlers.ToList();
            myLifetime   = lifetime;
            myLogger     = logger;
            mySolution   = solution;
            myShellLocks = shellLocks;
            myModuleReferenceResolveSync = moduleReferenceResolveSync;
            myChangeManager = changeManager;
            myProjects      = projects;

            scheduler.EnqueueTask(new SolutionLoadTask("Checking for Unity projects", SolutionLoadTaskKinds.Done, Register));
        }
Пример #3
0
        public PerProjectSettings(Lifetime lifetime, ISolution solution, ChangeManager changeManager,
                                  ModuleReferenceResolveSync moduleReferenceResolveSync,
                                  IViewableProjectsCollection projects,
                                  ISettingsSchema settingsSchema,
                                  SettingsStorageProvidersCollection settingsStorageProviders, IShellLocks locks,
                                  ILogger logger, InternKeyPathComponent interned,
                                  UnityProjectFileCacheProvider unityProjectFileCache)
        {
            mySolution                 = solution;
            myChangeManager            = changeManager;
            mySettingsSchema           = settingsSchema;
            mySettingsStorageProviders = settingsStorageProviders;
            myLocks    = locks;
            myLogger   = logger;
            myInterned = interned;
            myUnityProjectFileCache = unityProjectFileCache;
            myProjectMountPoints    = new Dictionary <IProject, SettingsStorageMountPoint>();
            myProjectLifetimes      = new Dictionary <IProject, Lifetime>();

            changeManager.RegisterChangeProvider(lifetime, this);
            changeManager.AddDependency(lifetime, this, moduleReferenceResolveSync);

            projects.Projects.View(lifetime, (projectLifetime, project) =>
            {
                myProjectLifetimes.Add(project, projectLifetime);

                if (!project.IsUnityProject())
                {
                    return;
                }

                InitialiseProjectSettings(project);
            });
        }
Пример #4
0
        public ProjectReferenceChangeTracker(
            Lifetime lifetime,
            ISolution solution,
            ModuleReferenceResolveSync moduleReferenceResolveSync,
            ChangeManager changeManager,
            IViewableProjectsCollection projects)
        {
            myHandlers         = new ConcurrentBag <Action <Lifetime, IProject> >();
            myProjectLifetimes = new Dictionary <IProject, Lifetime>();

            mySolution         = solution;
            myChangeManager    = changeManager;
            myProjectLifetimes = new Dictionary <IProject, Lifetime>();

            myChangeManager.RegisterChangeProvider(lifetime, this);
            myChangeManager.AddDependency(lifetime, this, moduleReferenceResolveSync);

            projects.Projects.View(lifetime, (projectLifetime, project) =>
            {
                myProjectLifetimes.Add(project, projectLifetime);

                if (!project.IsUnityProject())
                {
                    return;
                }

                Handle(project);
            });
        }
Пример #5
0
        public UnresolvedUnityReferencesTracker(
            Lifetime lifetime,
            ILogger logger,

            ISolution solution,
            IEnumerable <IHandler> handlers,

            ModuleReferenceResolveSync moduleReferenceResolveSync,
            ChangeManager changeManager)
        {
            myLifetime = lifetime;
            myLogger   = logger;

            mySolution = solution;
            myHandlers = handlers.ToList();

            myModuleReferenceResolveSync = moduleReferenceResolveSync;
            myChangeManager = changeManager;

            myChangeManager.RegisterChangeProvider(myLifetime, this);
            myChangeManager.AddDependency(myLifetime, this, myModuleReferenceResolveSync);
        }