![]() PhpStorm properly detects them, provides code completion, and adds import statements automatically: When the checkbox is cleared, on pressing Alt+Enter PhpStorm shows a popup that suggests to import the symbol:Ĭompletion and auto-import also work for React components, including stateless components. It’s no match against PHPStorm in it’s advanced features, but it can provide the most used features with some simple customizations.If this checkbox is selected, PhpStorm automatically inserts an import statement in JavaScript code when you complete a symbol exported using ES6 exports in another project file: Yet, by using extensions we can make it look and behave kind of like an IDE. VS code is not an IDE, but a code editor. There are a lot more extensions in the market and a million more posts that curate them, so I will leave this one kinda open and just drop a link to the VS code marketplace for you to take a look □. A personal favourite is GitLens, that complements the Git support of the editor with some cool, advanced functions (at the expense of a little performance loss). Integrations with Docker and various SQL database flavours are also available as plug-ins. Like this extension to add getter and setter methods, and this one or this one to generate constructor properties. There are a lot of extensions to add some little extra functionalities you might need. Laravel goto view allows to cmd+click in and other blade tags. laravel-blade is an extension to highlight syntax in Blade files.If there are name conflicts, a prompt shows all the options. PHP Namespace Resolver Allows to automatically import a class using Ctrl+Opt+I and automatically expand the class (a.k.a.: import it inline, to get \Path\To\Class) using Ctrl+Opt+E.PHP Dockblocker enhances the capabilities of Intelephense regarding the creation of phpdoc type comments.Here are some other extensions that might be handy to cover that missing 10% of features that are not bundled with Intelephense. Some other extensions you might want to install Automatically creates phpdoc annotations with configurable format, and reads them when writting method or function calls.Detect unused imports, unused private functions or unused variables.Autodetect installed libraries and bring them in suggestions based on your composer.json.Highlight syntax, type errors and other static analysis tools.Here are some of those features you now have: 90% of the functions you wanted from PHPStorm are already in VS code. (To open your settings, open the console with Cmd+Shift+P and search the key “Preferences: Open user settings (JSON)”)Īfter changing this, your PHP code will start behaving a little big “smarter”. To acheive this, add this line to your user settings: "": false, You will want to disable the default PHP suggestions integrated into VS code. Note: I'm not being payed by intelephense to write this! Uninstall PHP IntelliSense (it will be installed by default).Within Visual Studio Code, go to the “Extensions” tab and search PHP. ![]() This is literally 90% of the job and it’s super easy. The most important thing to do if you want to work with PHP in VS code is to disable the default language server and install PHP Intelephense. ![]() It’s highly optimized to work with JavaScript and TypeScript, featuring smart autocompletion, auto-imports, refactors, and other goodies.Īlthough no match to IDEs like PHPStorm, Visual Studio Code can be customized to have better support when working PHP. ![]() VS code is a tool mostly used by front-end developers. Setting up Visual Studio Code to work with PHP ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |