Exemple #1
0
 public CommandState GetCommandState(
     AutomaticLineEnderCommandArgs args,
     Func <CommandState> nextCommandHandler
     )
 {
     return(nextCommandHandler());
 }
Exemple #2
0
        public void ExecuteCommand(AutomaticLineEnderCommandArgs args, Action nextCommandHandler, CommandExecutionContext executionContext)
        {
            AssertIsForeground();
            if (AreSnippetsEnabled(args) &&
                args.TextView.Properties.TryGetProperty(typeof(AbstractSnippetExpansionClient), out AbstractSnippetExpansionClient snippetExpansionClient) &&
                snippetExpansionClient.IsFullMethodCallSnippet)
            {
                // Commit the snippet. Leave the caret in place, but clear the selection. Subsequent handlers in the
                // chain will handle the remaining Smart Break Line operations.
                snippetExpansionClient.CommitSnippet(leaveCaret: true);
                args.TextView.Selection.Clear();
            }

            nextCommandHandler();
        }
        void IChainedCommandHandler <AutomaticLineEnderCommandArgs> .ExecuteCommand(AutomaticLineEnderCommandArgs args, Action nextHandler, CommandExecutionContext context)
        {
            AssertIsForeground();

            if (sessionOpt == null)
            {
                // No computation.  Nothing to do.  Just let the editor handle this.
                nextHandler();
                return;
            }

            CommitOnEnter(out var sendThrough, out var committed);

            // We did not commit based on enter.  So our computation will still be running.  Stop it now.
            if (!committed)
            {
                this.DismissSessionIfActive();
                nextHandler();
            }
        }
Exemple #4
0
        void ICommandHandler <AutomaticLineEnderCommandArgs> .ExecuteCommand(AutomaticLineEnderCommandArgs args, Action nextHandler)
        {
            AssertIsForeground();

            if (sessionOpt == null)
            {
                // No computation.  Nothing to do.  Just let the editor handle this.
                nextHandler();
                return;
            }

            // We are computing a model.  Commit it if we compute any selected item.
            bool sendThrough, committed;

            CommitOnEnter(out sendThrough, out committed);

            // We did not commit based on enter.  So our computation will still be running.  Stop it now.
            if (!committed)
            {
                this.StopModelComputation();
                nextHandler();
            }
        }
 public void ExecuteCommand(AutomaticLineEnderCommandArgs args, Action nextHandler)
 {
     AssertIsForeground();
     ExecuteCommandWorker(args, nextHandler);
 }
 public CommandState GetCommandState(AutomaticLineEnderCommandArgs args, Func <CommandState> nextHandler)
 {
     AssertIsForeground();
     return(GetCommandStateWorker(args, nextHandler));
 }
 VSCommanding.CommandState IChainedCommandHandler <AutomaticLineEnderCommandArgs> .GetCommandState(AutomaticLineEnderCommandArgs args, Func <VSCommanding.CommandState> nextHandler)
 {
     AssertIsForeground();
     return(nextHandler());
 }