Interactive shell doesn't complete property names
Nessuno ha ancora preso questa issue.
- Lingua principale
- C
- Stelle
- 40.4k
- Fork
- 8.1k
- Merge medio
- 2g 13h
- PR unite (30g)
- 96
Descrizione
Description
According to the documentation:
The interactive shell also features tab completion for functions, constants, class names, variables, static method calls and class constants.
Only function, class and method names seems to be completing when hitting the TAB key.
Also, the completion is not contextualized: after $, it should be only variable names (not function and class names), and after -> it should be only property and method names of the current object.
The following command to run the interactive shell:
php -a
Completion of variable name
The following shell code:
php > $container = 'hello';
php > $co [⇥TAB]
Resulted in this output:
Collator collator_get_strength constant
collator_asort collator_set_attribute convert_uudecode
collator_compare collator_set_strength convert_uuencode
collator_create collator_sort copy
collator_get_attribute collator_sort_with_sort_keys cos
collator_get_error_code compact cosh
collator_get_error_message CompileError count
collator_get_locale connection_aborted count_chars
collator_get_sort_key connection_status Countable
But I expected this output instead:
$container
Completion of property name
The following shell code:
php > $object = (object) ['foo' => 'bar'];
php > $object->fo [⇥TAB]
Resulted in this output:
fopen forward_static_call forward_static_call_array
But I expected this output instead:
foo
PHP version
PHP 8.4.3 (cli) (built: Jan 15 2025 01:03:17) (NTS)
Copyright (c) The PHP Group
Built by Homebrew
Zend Engine v4.4.3, Copyright (c) Zend Technologies
with Xdebug v3.4.1, Copyright (c) 2002-2025, by Derick Rethans
with Zend OPcache v8.4.3, Copyright (c), by Zend Technologies
PHP Version
PHP 8.4.3
Operating System
Mac 15.3 (24D60)
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia eseguendo php -a e riproducendo gli esempi di completamento di variabili e proprietà riportati nell'issue. Segui il punto di ingresso del completamento della shell interattiva e determina come vengono selezionati i candidati correnti. Il lavoro è completato quando $co viene completato solo in $container e $object-\u003efo viene completato in foo, mantenendo il comportamento di completamento documentato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- php
- Ambito
- cli
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100