예제 #1
0
        public void Execute(IDataContext context, DelegateExecute nextExecute)
        {
            IProjectFile projectFile = GetProjectFile(context);

            if (projectFile == null)
            {
                return;
            }

            IPsiSourceFile sourceFile = projectFile.ToSourceFile();

            if (sourceFile == null)
            {
                return;
            }
            IFile file = sourceFile.GetTheOnlyPsiFile(CSharpLanguage.Instance);

            if (file == null)
            {
                return;
            }

            file.GetPsiServices().Transactions.Execute("Reflow & Retag XML Documentation Comments",
                                                       () =>
            {
                using (WriteLockCookie.Create())
                    file.ProcessChildren <IDocCommentBlockOwnerNode>(x =>
                                                                     CommentReflowAndRetagAction.ReflowAndRetagCommentBlockNode(x.GetSolution(), null, x.GetDocCommentBlockNode())
                                                                     );
            });
        }
예제 #2
0
        public void Process(IPsiSourceFile sourceFile, IRangeMarker rangeMarker, CodeCleanupProfile profile, IProgressIndicator progressIndicator)
        {
            IFile file = sourceFile.GetTheOnlyPsiFile(CSharpLanguage.Instance);

            if (file == null)
            {
                return;
            }

            if (!profile.GetSetting(DescriptorInstance))
            {
                return;
            }

            file.GetPsiServices().Transactions.Execute("Reflow & Retag XML Documentation Comments",
                                                       () =>
            {
                using (_shellLocks.UsingWriteLock()) {
                    foreach (var documentBlockOwner in file.Descendants <IDocCommentBlockOwner>())
                    {
                        CommentReflowAndRetagAction.ReflowAndRetagCommentBlockNode(
                            documentBlockOwner.GetSolution(),
                            null,
                            documentBlockOwner.DocCommentBlock);
                    }
                };
            });
        }
        public void Execute(IDataContext context, DelegateExecute nextExecute)
        {
            IProjectFile projectFile = GetProjectFile(context);

            if (projectFile == null)
            {
                return;
            }

            IPsiSourceFile sourceFile = projectFile.ToSourceFile();

            if (sourceFile == null)
            {
                return;
            }
            IFile file = sourceFile.GetTheOnlyPsiFile(CSharpLanguage.Instance);

            if (file == null)
            {
                return;
            }

            file.GetPsiServices().Transactions.Execute("Reflow & Retag XML Documentation Comments",
                                                       () =>
            {
                using (WriteLockCookie.Create()) {
                    foreach (var docCommentBlockOwner in file.Descendants <IDocCommentBlockOwner>())
                    {
                        CommentReflowAndRetagAction.ReflowAndRetagCommentBlockNode(docCommentBlockOwner.GetSolution(), null, docCommentBlockOwner.DocCommentBlock);
                    }
                }
            });
        }