VSCodeでimport文を自動にさせる方法

 

自動インポートしたくてVSCode拡張機能を追加したが、

思うような反応をしなかった。

結論としては、

元あるVSCodeの補完機能を止めることでうまく動いた。 

やっていく

f:id:atusibba1014:20210313092946p:plain

1、拡張機能のボタンを押す

2、『@builtin php』と検索する

3、PHP Language Featuresを選択

4、 無効にする

 

これでModuleとして存在するクラスのImportの補完機能が正常に働いた!

必要な方は、これに拡張機能PHP Intelephense, PHP Intelesense』などどうぞ!

参照記事
GitHub - bmewburn/vscode-intelephense: PHP intellisense for Visual Studio Code
PHP intellisense for Visual Studio Code. Contribute to bmewburn/vscode-intelephense development by creating an account on GitHub.
How to automatically import the namespace of a class in VS Code?
I want to add the namespace of a php class automatically with a shortcut/extension in vscode, but I can't find how to do this. <?php namespace App\Models;...

コメント

タイトルとURLをコピーしました