public UnityEventsElementContainer(ISolution solution, IShellLocks shellLocks, MetaFileGuidCache guidCache, AssetDocumentHierarchyElementContainer elementContainer)
 {
     mySolution   = solution;
     myShellLocks = shellLocks;
     myGuidCache  = guidCache;
     myAssetDocumentHierarchyElementContainer = elementContainer;
 }
Ejemplo n.º 2
0
        public static Guid?GetGuidFor(MetaFileGuidCache metaFileGuidCache, ITypeElement typeElement)
        {
            // partial classes
            var declarations = typeElement.GetDeclarations();

            foreach (var declaration in declarations)
            {
                var sourceFile = declaration.GetSourceFile();
                if (sourceFile == null || !sourceFile.IsValid())
                {
                    continue;
                }

                if (!typeElement.ShortName.Equals(sourceFile.GetLocation().NameWithoutExtension))
                {
                    continue;
                }

                if (typeElement.TypeParameters.Count != 0)
                {
                    continue;
                }

                if (typeElement.GetContainingType() != null)
                {
                    continue;
                }

                var guid = metaFileGuidCache.GetAssetGuid(sourceFile);
                return(guid);
            }

            return(null);
        }
Ejemplo n.º 3
0
 public UnitySceneDataCache(Lifetime lifetime, IPersistentIndexManager persistentIndexManager,
                            UnitySceneDataLocalCache unitySceneDataLocalCache, MetaFileGuidCache metaFileGuidCache)
     : base(lifetime, persistentIndexManager, UnitySceneData.Marshaller)
 {
     myUnitySceneDataLocalCache = unitySceneDataLocalCache;
     myMetaFileGuidCache        = metaFileGuidCache;
 }
Ejemplo n.º 4
0
        public PrefabImportCache(Lifetime lifetime, ISolution solution, ISettingsStore store, MetaFileGuidCache metaFileGuidCache, UnityExternalFilesModuleFactory unityExternalFilesModuleFactory, IShellLocks shellLocks)
        {
            myMetaFileGuidCache = metaFileGuidCache;
            myShellLocks        = shellLocks;
            metaFileGuidCache.GuidChanged.Advise(lifetime, e =>
            {
                myShellLocks.AssertWriteAccessAllowed();
                var set = new HashSet <Guid>();
                if (e.oldGuid != null)
                {
                    InvalidateImportCache(e.oldGuid.Value, set);
                }

                if (e.newGuid != null)
                {
                    InvalidateImportCache(e.newGuid.Value, set);
                }
            });

            myUnityExternalFilesPsiModule = unityExternalFilesModuleFactory.PsiModule;

            var boundSettingsStoreLive = store.BindToContextLive(lifetime, ContextRange.Smart(solution.ToDataContext()));

            myCacheEnabled = boundSettingsStoreLive.GetValueProperty(lifetime, (UnitySettings key) => key.IsPrefabCacheEnabled);
        }
Ejemplo n.º 5
0
        public static Guid?GetGuidFor(MetaFileGuidCache metaFileGuidCache, ITypeElement typeElement)
        {
            var sourceFile = typeElement.GetDeclarations().FirstOrDefault()?.GetSourceFile();

            if (sourceFile == null || !sourceFile.IsValid())
            {
                return(null);
            }

            if (typeElement.TypeParameters.Count != 0)
            {
                return(null);
            }

            if (typeElement.GetContainingType() != null)
            {
                return(null);
            }

            if (!typeElement.ShortName.Equals(sourceFile.GetLocation().NameWithoutExtension))
            {
                return(null);
            }

            var guid = metaFileGuidCache.GetAssetGuid(sourceFile);

            return(guid);
        }
Ejemplo n.º 6
0
 private MonoScriptReference(IPlainScalarNode owner, FileID fileID, MetaFileGuidCache metaFileGuidCache,
                             string resolvedName)
     : base(owner)
 {
     myFileID            = fileID;
     myMetaFileGuidCache = metaFileGuidCache;
     myResolvedName      = resolvedName;
 }
 public AnimatorScriptUsagesElementContainer([NotNull] IPersistentIndexManager manager,
                                             [NotNull] IShellLocks shellLocks,
                                             [NotNull] MetaFileGuidCache metaFileGuidCache)
 {
     myManager           = manager;
     myShellLocks        = shellLocks;
     myMetaFileGuidCache = metaFileGuidCache;
 }
Ejemplo n.º 8
0
 public AnimationEventUsagesContainer([NotNull] IPersistentIndexManager manager,
                                      [NotNull] IShellLocks shellLocks,
                                      [NotNull] MetaFileGuidCache metaFileGuidCache,
                                      [NotNull] ISolution solution)
 {
     myShellLocks        = shellLocks;
     myMetaFileGuidCache = metaFileGuidCache;
     mySolution          = solution;
 }
Ejemplo n.º 9
0
 public AssetDocumentHierarchyElementContainer(IPersistentIndexManager manager, PrefabImportCache prefabImportCache, IShellLocks shellLocks,
                                               UnityExternalFilesModuleFactory psiModuleProvider, MetaFileGuidCache metaFileGuidCache, IEnumerable <IAssetInspectorValueDeserializer> assetInspectorValueDeserializers)
 {
     myManager           = manager;
     myPrefabImportCache = prefabImportCache;
     myShellLocks        = shellLocks;
     myPsiModule         = psiModuleProvider.PsiModule;
     myMetaFileGuidCache = metaFileGuidCache;
     myAssetInspectorValueDeserializers = assetInspectorValueDeserializers;
 }
Ejemplo n.º 10
0
        public static string GetComponentName(MetaFileGuidCache metaFileGuidCache, IComponentHierarchy componentHierarchy)
        {
            if (componentHierarchy is IScriptComponentHierarchy scriptComponent)
            {
                var result = metaFileGuidCache.GetAssetNames(scriptComponent.ScriptReference.ExternalAssetGuid).FirstOrDefault();
                if (result != null)
                {
                    return(result);
                }
            }

            return(componentHierarchy.Name);
        }
Ejemplo n.º 11
0
 // IconHost is optional so that we don't fail if we're in tests
 public UnityYamlExtraGroupingRulesProvider(MetaFileGuidCache metaFileGuidCache = null, UnitySolutionTracker unitySolutionTracker = null, IconHost iconHost = null)
 {
     if (unitySolutionTracker != null && unitySolutionTracker.IsUnityProject.HasValue() && unitySolutionTracker.IsUnityProject.Value &&
         iconHost != null && metaFileGuidCache != null)
     {
         ExtraRules = new IRiderUsageGroupingRule[]
         {
             new GameObjectUsageGroupingRule(iconHost),
             new ComponentUsageGroupingRule(metaFileGuidCache, iconHost)
         };
     }
     else
     {
         ExtraRules = new IRiderUsageGroupingRule[0];
     }
 }
 public UnityAssetReferenceSearcher(DeferredCacheController deferredCacheController,
                                    AssetDocumentHierarchyElementContainer assetDocumentHierarchyElementContainer,
                                    [NotNull, ItemNotNull] IEnumerable <IScriptUsagesElementContainer> scriptsUsagesElementContainers,
                                    UnityEventsElementContainer unityEventsElementContainer,
                                    [NotNull] AnimationEventUsagesContainer animationEventUsagesContainer,
                                    AssetInspectorValuesContainer assetInspectorValuesContainer,
                                    MetaFileGuidCache metaFileGuidCache,
                                    IDeclaredElementsSet elements,
                                    bool findCandidates)
 {
     myDeferredCacheController = deferredCacheController;
     myAssetDocumentHierarchyElementContainer = assetDocumentHierarchyElementContainer;
     myScriptsUsagesElementContainers         = scriptsUsagesElementContainers;
     myUnityEventsElementContainer            = unityEventsElementContainer;
     myAnimationEventUsagesContainer          = animationEventUsagesContainer;
     myAssetInspectorValuesContainer          = assetInspectorValuesContainer;
     myElements = elements;
 }
Ejemplo n.º 13
0
 public AnimationUsagesDataElement([NotNull] ISolution solution, [NotNull] MetaFileGuidCache metaFileGuidCache)
 {
     Events = new List <AnimationUsage>();
 }
Ejemplo n.º 14
0
 public UnityYamlSearchGuru(UnityApi unityApi, MetaFileGuidCache metaFileGuidCache, IEnumerable <ITrigramIndex> indices)
 {
     myUnityApi          = unityApi;
     myMetaFileGuidCache = metaFileGuidCache;
     myIndices           = indices;
 }
 public AssetUsagesElementContainer(IShellLocks shellLocks, IPersistentIndexManager persistentIndexManager, MetaFileGuidCache metaFileGuidCache)
 {
     myShellLocks             = shellLocks;
     myPersistentIndexManager = persistentIndexManager;
     myMetaFileGuidCache      = metaFileGuidCache;
 }
Ejemplo n.º 16
0
 public AssetScriptUsagesElementContainer(IShellLocks shellLocks, MetaFileGuidCache metaFileGuidCache)
 {
     myShellLocks        = shellLocks;
     myMetaFileGuidCache = metaFileGuidCache;
 }
Ejemplo n.º 17
0
 public UnitySceneDataLocalCache(MetaFileGuidCache guidCache, IShellLocks shellLocks)
 {
     myGuidCache  = guidCache;
     myShellLocks = shellLocks;
 }
Ejemplo n.º 18
0
 public MonoScriptReference(IPlainScalarNode owner, FileID fileID, MetaFileGuidCache metaFileGuidCache)
     : this(owner, fileID, metaFileGuidCache, null)
 {
 }
 public UnitySceneDataLocalCache(ISolution solution, MetaFileGuidCache guidCache, IShellLocks shellLocks)
 {
     mySolution   = solution;
     myGuidCache  = guidCache;
     myShellLocks = shellLocks;
 }
Ejemplo n.º 20
0
 // Note that the name is in CamelCase and spaces are added in the frontend
 public ComponentUsageGroupingRule(MetaFileGuidCache metaFileGuidCache, [NotNull] IconHost iconHost)
     : base("UnityComponent", UnityObjectTypeThemedIcons.UnityComponent.Id, iconHost, 8.0)
 {
     myMetaFileGuidCache = metaFileGuidCache;
 }
 public UnityAssetReferenceSearcher(DeferredCacheController deferredCacheController, AssetDocumentHierarchyElementContainer assetDocumentHierarchyElementContainer, AssetUsagesElementContainer assetUsagesElementContainer,
                                    AssetMethodsElementContainer assetMethodsElementContainer, AssetInspectorValuesContainer assetInspectorValuesContainer, MetaFileGuidCache metaFileGuidCache, IDeclaredElementsSet elements, bool findCandidates)
 {
     myDeferredCacheController = deferredCacheController;
     myAssetDocumentHierarchyElementContainer = assetDocumentHierarchyElementContainer;
     myAssetUsagesElementContainer            = assetUsagesElementContainer;
     myAssetMethodsElementContainer           = assetMethodsElementContainer;
     myAssetInspectorValuesContainer          = assetInspectorValuesContainer;
     myElements = elements;
 }
Ejemplo n.º 22
0
 public MonoScriptReference(IPlainScalarNode owner, FileID fileID, MetaFileGuidCache metaFileGuidCache)
     : base(owner)
 {
     myFileID            = fileID;
     myMetaFileGuidCache = metaFileGuidCache;
 }
Ejemplo n.º 23
0
 public UnitySceneProcessor(UnityVersion version, MetaFileGuidCache metaFileGuidCache, UnityExternalFilesModuleFactory factory)
 {
     myVersion           = version;
     myMetaFileGuidCache = metaFileGuidCache;
     myFactory           = factory;
 }
Ejemplo n.º 24
0
 public string GetScriptAssetGuid(UnitySceneDataLocalCache cache, MetaFileGuidCache guidCache)
 {
     return(cache.GetScriptGuid(UnitySceneDataLocalCache.GetSourceFileWithPointedYamlDocument(myOwner.GetSourceFile(), myFileId, guidCache), myFileId.fileID));
 }