Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Console] rewrite autocomplete interactive mode from console #26458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

ybenhssaien
Copy link
Contributor

@ybenhssaien ybenhssaien commented Mar 8, 2018

Q A
Branch? 4.0
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? not tested
Fixed tickets #26321
License MIT

Description :

Using the command make:subscriber with an event suscriber kernel.controller on the interactive mode (Responding to the 'What event do you want to subscribe to?' question).
Submited : kernel.controller
Result : kernel.controller_arguments

Console :

image

Result :

image

Bug caused by :

When puting an Enter character on the console, a last check is made to verify even the character is a new line \n or a tabulation \t, then choose the returned autocomplete from the matches array with an $ofs = 0 which return $matches[0] = 'kernel.controller_arguments on the following lines :

}
} elseif (ord($c) < 32) {
if ("\t" === $c || "\n" === $c) {
if ($numMatches > 0 && -1 !== $ofs) {
$ret = $matches[$ofs];

@nicolas-grekas
Copy link
Member

Thank you @youssefbenhssaien. Could you add some tests please?
Also I suppose this should be merged in a lower branch if the bug exists there also, maybe 2.7? (I didn't check; but let's not focus on this for now.)

@nicolas-grekas nicolas-grekas changed the title [Console] #26321 - rewrite autocomplete interactive mode from console [Console] rewrite autocomplete interactive mode from console Mar 14, 2018
@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Mar 14, 2018
@nicolas-grekas
Copy link
Member

This is now fixed thanks to #26875.
If that's not the case, please report of course.
Thanks for working on this @youssefbenhssaien

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants