用户设置:文件–>首选项–>设置(点击右边更多设置,点击打开settings.json),将下面配置复制粘贴即可(按个人习惯修改相关信息)
"git.ignoreLegacyWarning": true,
"window.zoomLevel": 0,
"phpfmt.php_bin": "D:\\phpstudy_pro\\Extensions\\php\\php7.3.4nts\\php.exe",
"php.validate.executablePath": "D:\\phpstudy_pro\\Extensions\\php\\php7.3.4nts\\php.exe",
"php.executablePath": "D:\\phpstudy_pro\\Extensions\\php\\php7.3.4nts\\php.exe",
"editor.wordWrap": "on",
"php-cs-fixer.onsave": true,
"php-cs-fixer.formatHtml": true,
"editor.formatOnSave": true,
"editor.formatOnSaveTimeout": 5000,
"php-cs-fixer.executablePath": "${extensionPath}\\php-cs-fixer.phar",
"php-cs-fixer.executablePathWindows": "", //eg: php-cs-fixer.bat
"php-cs-fixer.rules": "@PSR2",
"php-cs-fixer.config": ".php_cs;.php_cs.dist",
"php-cs-fixer.allowRisky": false,
"php-cs-fixer.pathMode": "override",
"php-cs-fixer.exclude": [],
"php-cs-fixer.autoFixByBracket": true,
"php-cs-fixer.autoFixBySemicolon": false,
"php-cs-fixer.documentFormattingProvider": true
1.前提条件:安装7.0以上版本php
2.phpIntelliSense 插件的安装
PHP Intellisense PHP自动补全工具 //配置 "php.validate.executablePath" "php.executablePath":
PHP Intellisense -Crane PHP自动补全工具 //配置 "php.validate.executablePath" "php.executablePath":
三、Ctrl + S自动格式化php代码:phpfmt - PHP formatter //配置 "editor.formatOnSave": true, "editor.formatOnSaveTimeout": 5000,
默认使用 PSR2 规范
四、Ctrl + S自动格式化php代码:php cs fixer
配置:
"php-cs-fixer.onsave": true, //Ctrl + S 时格式化php代码
"php-cs-fixer.formatHtml": true //格式化.php文件中的html代码(html、css、js)
七、生成函数的注释:PHP DocBlocker(/**)