-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP & code snippets #64
Comments
vscode code snippets https://code.visualstudio.com/docs/editor/userdefinedsnippets
https://code.visualstudio.com/api/language-extensions/snippet-guide {
"contributes": {
"snippets": [
{
"language": "javascript",
"path": "./snippets.json"
}
]
}
}
https://www.freecodecamp.org/news/definitive-guide-to-snippets-visual-studio-code/ |
https://stackoverflow.com/questions/44321000/visual-studio-code-user-snippets-not-working {
"PHP 8 Template": {
"scope": "php, html",
"prefix": "p8t",
"body": [
"<?php",
"",
"/**",
" * ",
" * @author xgqfrms",
" * @license MIT",
" * @copyright xgqfrms",
" * @created 2022-12-1$1",
" * @modified ",
" * ",
" * @description $2",
" * @link http://www.webhacker.com/$3.php",
" * ",
" */",
"",
"$args = $_GET[\"args\"];",
"// $params = $_POST[\"params\"];",
"// $all_in_one = $_REQUEST[\"args\"];",
"echo \"<h1 style=\"color: red;\">red color: $args</h1>\";",
"/*",
"",
"",
"*/",
"",
"?>"
],
"description": "PHP 8 Template & code snippets!"
}
}
|
bug
solutionhttps://stackoverflow.com/questions/44321000/visual-studio-code-user-snippets-not-working |
global code snippets~/Library/Application Support/Code/User/snippets/php.code-snippets
{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
} {
"PHP 8 Template": {
"prefix": "p8t",
"body": [
"<?php",
"",
"/**",
" * ",
" * @author xgqfrms",
" * @license MIT",
" * @copyright xgqfrms",
" * @created 2022-12-1$1",
" * @modified ",
" * ",
" * @description $2",
" * @link http://www.webhacker.com/$3.php",
" * ",
" */",
"",
"$args = $_GET[\"args\"];",
"// $params = $_POST[\"params\"];",
"// $all_in_one = $_REQUEST[\"args\"];",
"echo \"<h1 style=\"color: red;\">red color: $args</h1>\";",
"/*",
"",
"",
"*/",
"",
"?>"
],
"description": "PHP 8 Template & code snippets!"
}
}
|
PHP & code snippets
https://github.com/xgqfrms/vscode/blob/master/code-snippets/php.json
The text was updated successfully, but these errors were encountered: