khustabak's avatar

VS Code Intellisense setup that actually makes sense?

I've always had this issue: Brand new setup of VS Code with Laravel 10 and PHP 8.2. I open up a new Laravel app and create a migration. I want to add a new string field to the table, so I type "table".

Intellisense pops up and has some choices for me. I figured it's 2023, it's smart enough to know what I'm doing, so I pick the first one, expecting a follow up set of field types...

The other options aren't much better, offering to create a new table, or set up some check on table existence.

If I type "$" it starts recommending unrelated stuff like $_COOKIE or $_ENV.

Finally, if I type "string", I can select the third option down to get the desired result.

The only extensions I have loaded right now is "Laravel Extra Intellisense" by amir and "Laravel Snippets" by Winnie Lin.

Has anyone found a good setup for VS Code that actually make sense and won't suggest HTML tags while editing a PHP file and have some sort of understanding of what I'm doing based on the current class and method I'm in?

0 likes
2 replies
CamKem's avatar

Use github copilot, it's much much better as it uses the OpenAI api (machine learning) to generate code completions.

Emokores's avatar

These are the extensions I have on my VS Code setup:

intelephense (purchased license. But you have to disable one built-in PHP setting for it to work well. read the docs), PHP Files, PHP Namespace Resolver, PHPfmt - PHP Formatter, Laravel Extra IntelliSense, Laravel IntelliSense, Laravel Blade Formatter, Laravel Blade Spacer, Laravel Snippets, Laravel Blade, Laravel IDE helper (read the docs for setup), Laravel Pint, Path IntelliSense, Codespell Checker, Better comments, ES7+ React/Redux/React-Native snippets, React-Native tools, among the many others. But those are my cors. You can choose what works for your workflow.

Please or to participate in this conversation.