eclipse-platform / eclipse-platform/eclipse.platform

Debug console with command line history

Aperta
#532 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
165
Fork
174
Merge medio
2g 8h
PR unite (30g)
22

Descrizione

Migrated from [Bug 561001](https://bugs.eclipse.org/bugs/show_bug.cgi?id=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.
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia esaminando ProcessConsole e la sua API supportata, quindi analizza IOConsoleViewer, il campo documentListener e il partizionatore dei documenti descritto nell’issue. Il completamento consiste nel fornire una cronologia dei comandi o punti di estensione supportati per Ctrl+Up e Ctrl+Down, senza ricorrere all’introspezione, e nel verificare che i comandi dell’utente possano essere richiamati nella console.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
devtools
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
20/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.