Esempio n. 1
0
        /// <inheritdoc/>
        protected override Action <ITextControl> ExecutePsiTransaction(ISolution solution, IProgressIndicator progress)
        {
            return(textControl =>
            {
                using (solution.GetComponent <DocumentTransactionManager>()
                       .CreateTransactionCookie(DefaultAction.Commit, "action name"))
                {
                    var services = solution.GetPsiServices();
                    services.Transactions.Execute(
                        "Code cleanup",
                        () => services.Locks.ExecuteWithWriteLock(() =>
                    {
                        ICSharpTypeAndNamespaceHolderDeclaration holder = _highlighting.TypeAndNamespaceHolder;

                        Fixes.FixOrder(holder, _highlighting.Config);
                        Fixes.FixSpacing(holder, _highlighting.Config);
                    }));
                }
            });
        }
Esempio n. 2
0
 /// <summary>
 /// Fixes the order and spacing for the using blocks in a file or namespace declaration block.
 /// </summary>
 /// <param name="holder">The file or namespace declaration blocks to check.</param>
 /// <param name="configuration">The configuration defining the correct order
 /// and spacing.</param>
 private void CleanUsings(
     ICSharpTypeAndNamespaceHolderDeclaration holder, OrderUsingsConfiguration configuration)
 {
     Fixes.FixOrder(holder, configuration);
     Fixes.FixSpacing(holder, configuration);
 }