stevenlovegrove / qtcreator

Other
0 stars 1 forks source link

Feature: Better 'Command Line Arguments' input #3

Open stevenlovegrove opened 8 years ago

stevenlovegrove commented 8 years ago

Background

In QtCreator, a 'Run Configuration' for a target application includes a 'Command Line Arguments' input box to specify a programs arguments.

Problem

For a target 'Run Configuration' with a long command line, it is very difficult to edit it's arguments within such a small input area. It is also arguably more difficult to construct the command line arguments without the functionality of a shell which is able to tab-complete filenames.

Proposal

https://github.com/stevenlovegrove/qtcreator/commit/ece46f031994bb6ac5bc0c3e0786ce7da66cec7a contains a simple patch which changes the 'Command Line Arguments' FancyLineEdit input box to a multiline QPlainTextEdit. My proposal is to incorporate filename tab-completion into something which operates similarly to this box (which may already exist in the code-base), as well as any other niceties already found in FancyLineEdit, and try to get this merged upstream.

Implementation and review:

_See https://wiki.qt.io/Building_Qt_Creator_from_Git for instructions on building QtCreator from Source._

Tests

prodoelmit commented 8 years ago

That's definitely a great feature. Should it behave differently on Windows (cmd-style) and others (bash-style)?

For bash-style it's required to have a field where possible completions would show.

stevenlovegrove commented 8 years ago

I'm imagining that it will look a lot like the completion of #includes within QtCreator's main editor, rooted from the run configuration working directory. In that case, a drop-down box appears at the carat with files containing the given prefix.

I don't know if completing things other than filenames makes sense - it may be useful to offer tab-completion of historic arguments on a per-argument basis - what do you think?

For example:

Previous entries for this target (potentially different run configurations)

prog -a somea -b argb -c argc1
prog -b argb -c argc2
prog -a somea -c argc3

Might lead to the following tab-completion sequence

where <tab>(options) listed in dropdown, tab completing common prefx.

prog -<tab>(-a, -b, -c) prog -c a<tab>(argb,argc1,argc2,argc3,antelope.txt,aardvark.dat) prog -c arg<tab>(arga,argb,argc1,argc2,argc3)