eclipse-platform / eclipse-platform/eclipse.platform

Debug console with command line history

Offen
#532 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

  • #112 von @chgenly — ohne Merge geschlossen
Vorherrschende Sprache
Java
Sterne
165
Forks
174
Ø Merge
2 T. 8 Std.
Gemergte PRs (30 T.)
22

Beschreibung

Migrated from Bug 561001

We need a debug console with command line history.  The
current console does not provide this.  We are currently
using introspection to allow us to hook into ProcessConsole
to add command line history.  Pressing ctrl up arrow and 
ctrl down arrow allow us to navigate the history.

Introspection is a very fragile way of doing it.  Every time 
there is a new Eclipse release, we have to update our
code to track implementation changes in ProcessConsole.

We would like one of these

1) Provide a command line history in ProcessConsole.
or
2) Change ProcessConsole with supported API to allow
   developers to add a command line history.
   
Here is a high level overview of our fragile implementation
just to give you a sense of what is involved.

Given an IOConsoleViewer use intropsection to replace
the documentListener field with a new listener.  The
new listener will function like the original version
except that if text is being appended at the end of
the document, it will move the cursor there.  This works
even if the text being appended has no new-line inserted yet.

Given a process console, get the document, and replace the
partitioner.  The new partitioner functions exactly like 
the old one with the exception that when user input (a
command typed by the user, terminated with a newline)
is sent to the input stream, the user's command is also added
to the command history for the console's document.

Add handlers for ctrl up arrow and ctrl down arrow.  These
handlers grab the appropriate line in the history and stuff
it in to the console.  To stuff it into the console, we
call upone our improved document partitioner to do this.
The improved partitioner ensures the last partition is not
read only.  If it is, a new partition is created which is 
read write.  This last partition, newly created or not
is where history is inserted.  The last partition
may already be read write if the user has already started
typing a line.  In which case this partial line is replace
with the history line.

Our implementation makes simplifying assumptions about types
that we know to be true for our use case.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der Durchsicht von ProcessConsole und seiner unterstützten API. Untersuche anschließend IOConsoleViewer, das Feld documentListener und den im Issue beschriebenen Dokumentpartitionierer. Als abgeschlossen gilt die Bereitstellung einer Befehlshistorie oder unterstützter Erweiterungspunkte für Ctrl+Up und Ctrl+Down, ohne auf Introspektion zurückzugreifen, sowie die Überprüfung, dass Benutzerbefehle in der Konsole abgerufen werden können.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
devtools
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
20/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.