Пример #1
0
        private IDeclarationsCache GetAssemblyDeclarationsCache(IModule moduleHandle)
        {
#if RESHARPER_31 || RESHARPER_40 || RESHARPER_41
            IProject projectHandle = moduleHandle as IProject;
            if (projectHandle != null)
                return psiManager.GetDeclarationsCache(DeclarationsCacheScope.ProjectScope(projectHandle, false), true);

            IAssembly assemblyHandle = (IAssembly) moduleHandle;
            return psiManager.GetDeclarationsCache(DeclarationsCacheScope.LibraryScope(assemblyHandle, false), true);
#elif RESHARPER_60_OR_NEWER
			var psiModule = PsiModuleManager.GetInstance(moduleHandle.GetSolution()).GetPrimaryPsiModule(moduleHandle);
#if RESHARPER_60
			var cacheManager = CacheManager.GetInstance(psiModule.GetSolution());
#endif
			return cacheManager.GetDeclarationsCache(psiModule, false, false);
#else
            IPsiModule psiModule = GetPsiModule(moduleHandle);
            if (psiModule == null)
                return null;
                
            return psiManager.GetDeclarationsCache(DeclarationsScopeFactory.ModuleScope(psiModule, false), true);
#endif
        }