maker-bundle icon indicating copy to clipboard operation
maker-bundle copied to clipboard

[autocorrect] make:entity selects incorrect class when input class contains part of another

Open monkeyArms opened this issue 4 years ago • 7 comments
trafficstars

I have an existing App\Entity\AppConfigSetting class, and now want to make App\Entity\AppConfig. Attempting make:entity with the non-existing "AppConfig" class gives me the following behavior:

Screenshot 2021-01-24 103923

I've had this happen several times over the past year - always when I'm trying to create a new class that contains part of an existing class name.

symfony/maker-bundle version 1.28

monkeyArms avatar Jan 24 '21 16:01 monkeyArms

I think the command just tries to autocomplete and you hit Enter, so it uses the value it suggested. Can you try:

  • Write AppConfig
  • Hit backspace
  • Then hit enter

mehdibo avatar Jan 29 '21 22:01 mehdibo

I tried as you suggested using "AppConfi" with the same result:

Screenshot 2021-01-29 164653

monkeyArms avatar Jan 29 '21 23:01 monkeyArms

Howdy @monkeyArms,

Can you please provide what operating system you're using, PHP Version, and if possible a copy of your composer.lock file so I can duplicate the problem locally? Thanks!

jrushlow avatar Jan 29 '21 23:01 jrushlow

Sure, here you go:

OS: Windows 10 Pro, version 2004 PHP: 7.3.9

composer.lock.txt

monkeyArms avatar Jan 29 '21 23:01 monkeyArms

Something I did not mention before, which may be important:

My IDE is PHPStorm, and I'm using Ansicon with Windows GIT bash for my terminal. My terminal shell path is: C:\bin\ansi160\x64\ansicon.exe" -p C:\Program Files\Git\bin\bash.exe

99.9% of things I use play well with this setup, but this one maker-bundle command does not.

monkeyArms avatar Jan 31 '21 00:01 monkeyArms

Do you have the same issue if you use the native Windows shell? or the built in PHP Storm Terminal?

jrushlow avatar Jan 31 '21 00:01 jrushlow

PHPStorm doesn't have a built in terminal (that I know of), but uses the native OS shell if that setting is unmodified, so in this case on Windows it's cmd.exe, which shows the following error message:

Screenshot 2021-01-30 195211

The native command prompt works fine for creating entities that don't share or start with the same characters:

image

monkeyArms avatar Jan 31 '21 02:01 monkeyArms