Пример #1
0
        protected void AssertHelper(string xmlDocId, Action <CodeAnnotationsCache, IDeclaredElement> assert)
        {
            WithSingleProject(EmptyList <string> .InstanceList, (lifetime, solution, project) => RunGuarded(() =>
            {
                var psiModule   = solution.PsiModules().GetPrimaryPsiModule(project, TargetFrameworkId.Default);
                var psiServices = solution.GetPsiServices();

                var declaredElement = XMLDocUtil.ResolveId(psiServices, xmlDocId, psiModule, true,
                                                           project.GetResolveContext());
                Assert.NotNull(declaredElement, "Declared element cannot be resolved from XML Doc ID {0}", xmlDocId);

                var annotationsCache = psiServices.GetCodeAnnotationsCache();

                assert(annotationsCache, declaredElement);
            }));
        }
        public RichTextBlock[] GetParamDescriptions()
        {
            var parameters        = myParameters;
            var paramDescriptions = new RichTextBlock[parameters.Count()];

            var i = 0;

            foreach (RuleDeclaration parameter in parameters)
            {
                paramDescriptions[i] = XmlDocRichTextPresenter.Run(
                    XMLDocUtil.ExtractParameterSummary(null, parameter.ShortName),
                    parameter.GetPsiModule(), false, PsiLanguage.Instance);
                i++;
            }

            return(paramDescriptions);
        }
Пример #3
0
        public static JetBrains.UI.RichText.RichText ProcessCRef(string crefValue, PsiLanguageType languageType, IPsiModule psiModule, DeclaredElementPresenterStyle presenterStyle)
        {
            var element = psiModule == null ? null : XMLDocUtil.ResolveId(psiModule.GetPsiServices(), crefValue, psiModule, true);

            return(element == null || !element.IsValid() ? new JetBrains.UI.RichText.RichText(XmlDocPresenterUtil.ProcessCref(crefValue), XmlDocRichTextPresenterEx.ourCRefStyle) : DeclaredElementPresenter.Format(languageType, presenterStyle, element));
        }