VSCode Snippets 设置PHP代码块
{

	"pubf":{
		"prefix": "pubf",
		"body": [
			"public function $1(){",
			"",
			"}"
		],
		"description": "定义公共方法"
	},
	"prif":{
		"prefix": "prif",
		"body": [
			"private function $1(){",
			"",
			"}"
		],
		"description": "定义私有方法"
	},
	"prof":{
		"prefix": "prof",
		"body": [
			"protected function $1(){",
			"",
			"}"
		],
		"description": "定义可继承方法"
	},
	"phpclass":{
		"prefix": "phpclass",
		"body": [
			"<?php",
			"",
			"namespace ${1:namespace}",
			"",
			"class $TM_FILENAME_BASE ${2:extends ${3:AnotherClass}} ${4:implements ${5:Interface}}",
            "{",
            "\t$0",
            "}",
            ""
		],
		"description": "定义可继承方法"
	},
}

解决vscode没有代码提示

进入设置->搜索prevent,取消此项的勾选

在这里插入图片描述

解决自定义的snippet在底部的问题

在设置里覆盖成这样

"editor.snippetSuggestions": "top"

参考地址:https://juejin.cn/post/6844903869424599053

https://segmentfault.com/a/1190000008064885

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇