public UnityEventsElementContainer(ISolution solution, IShellLocks shellLocks, MetaFileGuidCache guidCache, AssetDocumentHierarchyElementContainer elementContainer) { mySolution = solution; myShellLocks = shellLocks; myGuidCache = guidCache; myAssetDocumentHierarchyElementContainer = elementContainer; }
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); }
public UnitySceneDataCache(Lifetime lifetime, IPersistentIndexManager persistentIndexManager, UnitySceneDataLocalCache unitySceneDataLocalCache, MetaFileGuidCache metaFileGuidCache) : base(lifetime, persistentIndexManager, UnitySceneData.Marshaller) { myUnitySceneDataLocalCache = unitySceneDataLocalCache; myMetaFileGuidCache = metaFileGuidCache; }
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); }
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); }
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; }
public AnimationEventUsagesContainer([NotNull] IPersistentIndexManager manager, [NotNull] IShellLocks shellLocks, [NotNull] MetaFileGuidCache metaFileGuidCache, [NotNull] ISolution solution) { myShellLocks = shellLocks; myMetaFileGuidCache = metaFileGuidCache; mySolution = solution; }
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; }
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); }
// 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; }
public AnimationUsagesDataElement([NotNull] ISolution solution, [NotNull] MetaFileGuidCache metaFileGuidCache) { Events = new List <AnimationUsage>(); }
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; }
public AssetScriptUsagesElementContainer(IShellLocks shellLocks, MetaFileGuidCache metaFileGuidCache) { myShellLocks = shellLocks; myMetaFileGuidCache = metaFileGuidCache; }
public UnitySceneDataLocalCache(MetaFileGuidCache guidCache, IShellLocks shellLocks) { myGuidCache = guidCache; myShellLocks = shellLocks; }
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; }
// 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; }
public MonoScriptReference(IPlainScalarNode owner, FileID fileID, MetaFileGuidCache metaFileGuidCache) : base(owner) { myFileID = fileID; myMetaFileGuidCache = metaFileGuidCache; }
public UnitySceneProcessor(UnityVersion version, MetaFileGuidCache metaFileGuidCache, UnityExternalFilesModuleFactory factory) { myVersion = version; myMetaFileGuidCache = metaFileGuidCache; myFactory = factory; }
public string GetScriptAssetGuid(UnitySceneDataLocalCache cache, MetaFileGuidCache guidCache) { return(cache.GetScriptGuid(UnitySceneDataLocalCache.GetSourceFileWithPointedYamlDocument(myOwner.GetSourceFile(), myFileId, guidCache), myFileId.fileID)); }