public void Process(IPsiSourceFile sourceFile, IRangeMarker rangeMarker, CodeCleanupProfile profile, IProgressIndicator progressIndicator)
        {
            var file = sourceFile.GetTheOnlyPsiFile(CSharpLanguage.Instance);

            if (file == null)
            {
                return;
            }

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

            file.GetPsiServices().Transactions.Execute("Reflow XML Documentation Comments",
                                                       () =>
            {
                using (_shellLocks.UsingWriteLock()) {
                    foreach (var docCommentBlock in file.Descendants <IDocCommentBlock>())
                    {
                        CommentReflowAction.ReFlowCommentBlockNode(file.GetSolution(), progressIndicator, 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 XML Documentation Comments",
                () =>
            {
                using (WriteLockCookie.Create())
                    file.ProcessChildren <IDocCommentBlockOwnerNode>(x =>
                                                                     CommentReflowAction.ReFlowCommentBlockNode(x.GetSolution(), null, x.GetDocCommentBlockNode())
                                                                     );
            }
                );
        }
Beispiel #3
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 XML Documentation Comments",
                () => {
                using (WriteLockCookie.Create()) {
                    foreach (var docCommentBlockOwner in file.Descendants <IDocCommentBlockOwner>())
                    {
                        CommentReflowAction.ReFlowCommentBlockNode(
                            docCommentBlockOwner.GetSolution(),
                            null,
                            docCommentBlockOwner.DocCommentBlock);
                    }
                }
            });
        }