Exemple #1
0
        protected ITypeElement GetDeclaredType()
        {
            IProject project = GetProject();

            if (project == null)
            {
                return(null);
            }

#if RESHARPER_61
            IPsiModule psiModule = _psiModuleManager.GetPrimaryPsiModule(project);
            if (psiModule == null)
            {
                return(null);
            }

            IDeclarationsCache declarationsCache = _cacheManager.GetDeclarationsCache(psiModule, true, true);
#else
            IPsiModule psiModule = _provider.PsiModuleManager.GetPrimaryPsiModule(project);
            if (psiModule == null)
            {
                return(null);
            }

            IDeclarationsCache declarationsCache = _provider.CacheManager.GetDeclarationsCache(psiModule, true, true);
#endif
            return(declarationsCache.GetTypeElementByCLRName(_declaringTypeName));
        }
Exemple #2
0
        protected virtual IEnumerable <HighlightingInfo> FindFreeTextHighlightings(
            ITreeNode node,
            string text,
            DocumentRange textRange,
            HashSet <string> localIdentifierNames,
#if (RSHARP6 || RSHARP7)
            IDeclarationsCache declarationsCache
        public override IDeclaredElement GetDeclaredElement()
        {
            PsiManager         manager           = PsiManager.GetInstance(GetSolution());
            IDeclarationsCache declarationsCache = manager.GetDeclarationsCache(DeclarationsScopeFactory.ModuleScope(PsiModuleManager.GetInstance(GetSolution()).GetPrimaryPsiModule(GetProject()), false), true);

            return(declarationsCache.GetTypeElementByCLRName(GetTypeClrName()));
        }
Exemple #4
0
        public override IDeclaredElement GetDeclaredElement()
        {
            var solution                         = GetSolution();
            var module                           = PsiModuleManager.GetInstance(solution).GetPsiModule(GetProject().ProjectFile);
            IDeclarationsScope scope             = DeclarationsScopeFactory.ModuleScope(module, false);
            IDeclarationsCache declarationsCache = PsiManager.GetInstance(solution).GetDeclarationsCache(scope, true);

            return(declarationsCache.GetTypeElementByCLRName(GetTypeClrName()));
        }
        protected ITypeElement GetDeclaredType()
        {
            ISolution solution = GetSolution();

            if (solution == null)
            {
                return(null);
            }

            using (ReadLockCookie.Create())
            {
                IDeclarationsScope scope = DeclarationsScopeFactory.SolutionScope(solution, false);
                IDeclarationsCache cache = PsiManager.GetInstance(solution).GetDeclarationsCache(scope, true);
                return(cache.GetTypeElementByCLRName(_declaringTypeName));
            }
        }
Exemple #6
0
        public override IDeclaredElement GetDeclaredElement()
        {
            ISolution solution = GetSolution();

            if (solution == null)
            {
                return(null);
            }

            using (ReadLockCookie.Create())
            {
                DeclarationsCacheScope scope = DeclarationsCacheScope.SolutionScope(solution, false);
                IDeclarationsCache     cache = PsiManager.GetInstance(solution).GetDeclarationsCache(scope, true);
                return(cache.GetTypeElementByCLRName(GetTypeClrName()));
            }
        }
        protected ITypeElement GetDeclaredType()
        {
            IProject project = GetProject();

            if (project == null)
            {
                return(null);
            }
            PsiManager manager = PsiManager.GetInstance(project.GetSolution());

            using (ReadLockCookie.Create())
            {
                IDeclarationsCache declarationsCache = manager.GetDeclarationsCache(DeclarationsScopeFactory.ModuleScope(PsiModuleManager.GetInstance(project.GetSolution()).GetPrimaryPsiModule(project), true), true);
                return(declarationsCache.GetTypeElementByCLRName(myTypeName));
            }
        }
Exemple #8
0
        protected ITypeElement GetDeclaredType()
        {
            IProject project = GetProject();

            if (project == null)
            {
                return(null);
            }

            using (ReadLockCookie.Create())
            {
                var solution                         = GetSolution();
                var module                           = PsiModuleManager.GetInstance(solution).GetPsiModule(GetProject().ProjectFile);
                IDeclarationsScope scope             = DeclarationsScopeFactory.ModuleScope(module, true);
                IDeclarationsCache declarationsCache = PsiManager.GetInstance(solution).GetDeclarationsCache(scope, true);

                return(declarationsCache.GetTypeElementByCLRName(myTypeName));
            }
        }
        private void PopulateAssemblyTypes(List<StaticDeclaredTypeWrapper> types, INamespace namespaceHandle,
            IDeclarationsCache cache, bool includeNonPublicTypes)
        {
            if (namespaceHandle == null || ! namespaceHandle.IsValid())
                return;

            foreach (IDeclaredElement elementHandle in namespaceHandle.GetNestedElements(cache))
            {
                ITypeElement typeHandle = elementHandle as ITypeElement;
                if (typeHandle != null)
                {
                    PopulateAssemblyTypes(types, typeHandle, includeNonPublicTypes);
                }
                else
                {
                    INamespace nestedNamespace = elementHandle as INamespace;
                    if (nestedNamespace != null)
                        PopulateAssemblyTypes(types, nestedNamespace, cache, includeNonPublicTypes);
                }
            }
        }