Back to Blog 2 min read

Laravel's Official VS Code Extension

Laravel has introduced an official Visual Studio Code (VS Code) extension, currently in open beta testing, designed to enhance the development experience for Laravel developers.Please Note:Background...

Gurpreet Kait

Gurpreet Kait

Author

Laravel has introduced an official Visual Studio Code (VS Code) extension, currently in open beta testing, designed to enhance the development experience for Laravel developers.

Please Note:

  • Background Application Booting: The extension may boot your application in the background to gather information for features like autocompletion, linking, hovering, and diagnostics.
  • Binary Download: Upon installation, the extension downloads a small binary for PHP parsing purposes.

Features:

App Bindings:

  • Autocompletion for functions like app('auth'), App::make('auth.driver'), etc.
  • Direct linking to bindings.
  • Warnings for missing bindings.
  • Hover information.

Assets:

  • Autocompletion for asset paths, e.g., asset('my-image.png').
  • Direct linking to assets.
  • Warnings for missing assets.

Blade:

  • Syntax highlighting for Blade templates.

Config:

  • Autocompletion for configuration values, e.g., config('app.timezone').
  • Direct linking to config values.
  • Warnings for missing configurations.
  • Hover information.

Eloquent:

  • Method autocompletion for models.
  • Field autocompletion for methods like where().
  • Relationship method autocompletion.
  • Sub-query autocompletion.

Env:

  • Autocompletion for environment variables, e.g., env('APP_ENV').
  • Direct linking to .env values.
  • Warnings for missing environment variables.
  • Hover information.

Inertia:

  • Autocompletion for Inertia page components, e.g., inertia('Dashboard').
  • Direct linking to JavaScript views.
  • Warnings for missing views.
  • Hover information.

Route:

  • Autocompletion for route names, e.g., route('home').
  • Direct linking to route definitions.
  • Warnings for missing routes.
  • Hover information.

Middleware:

  • Autocompletion for middleware, e.g., Route::middleware('auth').
  • Direct linking to middleware handlers.
  • Warnings for missing middleware.
  • Hover information.

Translation:

  • Autocompletion for translation keys, e.g., __('messages.welcome').
  • Direct linking to translation files.
  • Warnings for missing translations.
  • Hover information.
  • Parameter autocompletion.

Validation:

  • Autocompletion for validation rules, e.g., Validator::make($data, ['email' => 'required|email']).

View:

  • Autocompletion for view names, e.g., view('welcome').
  • Direct linking to Blade view files.
  • Warnings for missing views.
  • Hover information.

On the Roadmap:

  • Integration with VS Code's test runner.
  • Livewire support.
  • Volt support.
  • Pint support.
  • Enhanced features in Blade files.

Official Launch: Visual Code Studio Marketplace

Happy Coding!