onecentlin / laravel-blade-snippets-vscode

Laravel blade snippets and syntax highlight support for Visual Studio Code
MIT License
138 stars 38 forks source link

php syntax suggestion not working in blade.php file #130

Open edenzul opened 3 years ago

edenzul commented 3 years ago

Hi all,

need some help here. my goal is to have syntax auto-suggestion & auto formating works for both php file and blade file.

when I enable "Laravel Blade Snippets", the syntax suggestion function in blade.php suddenly not working. But when I disable the "Laravel Blade Snippets", the php syntax suggestion is working again for blade.php. I tried to make it works by reinstall, restart and modify the editor.defaultformater, it seems still unsuccessful. is that behavior is expected ? are there conflicting with the extensions? kindly please share your experience how to resolve this issue.

current extensions & vscode in use:

  1. Laravel Blade Snippets v1.25.0 by Winnie Lin
  2. PHP Intelephense v1.6.3 by Ben Mewburn
  3. w3.css.autocomplete v0.0.3 by SuvamRox
  4. vscode v1.54.3

thanks a lot for your supports.

cpoftea commented 3 years ago

@edenzul as much as I know, by default VS Code doesn't have a language server for php. There's an extension PHP Intelliphense with powerful server language associated with .php files, but here's the thing...

This "blade" extension defines a new php language with different id instead of extending existing one. So .blade.php files associated with this language to provide syntax highlight, snippets etc - everything from this extension. But files cannot be associated with two languages simultaneously. So you have to switch associated language back and forth to get what you need - blade syntax, snippets, format, or php suggestions

At least for now, that is how it works