1+ {
2+ // Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
3+ // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
4+ // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
5+ // used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
6+ // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
7+ // Placeholders with the same ids are connected.
8+ // Example:
9+ // "Print to console": {
10+ // "scope": "javascript,typescript",
11+ // "prefix": "log",
12+ // "body": [
13+ // "console.log('$1');",
14+ // "$2"
15+ // ],
16+ // "description": "Log output to console"
17+ // }
18+ "react chrome debug" : {
19+ "prefix" : " debug-react" ,
20+ "scope" : " json,jsonc" ,
21+ "body" : [
22+ " {" ,
23+ " \" name\" : \" react chrome launch\" ," ,
24+ " \" type\" : \" chrome\" ," ,
25+ " \" request\" : \" launch\" ," ,
26+ // 为了安装插件不与平时使用的chrome冲突,可以使用canary版本,就是chrome的开发者版本,",
27+ // 这个版本的更新速度很快,有最新的特性,也有最新的bug",
28+ // \"runtimeExecutable\":\"canary\",
29+ " \" runtimeArgs\" : [" ,
30+ // 默认打开chrome开发者面板",
31+ " \" --auto-open-devtools-for-tabs\" ," ,
32+ " ]," ,
33+ // 设置用户信息保存目录,这样方便安装插件,保存cookie等信息。",
34+ " \" userDataDir\" : \" D:\\\\\\ chrome-dev-userDataDir\" ," ,
35+ " \" url\" : \" http://localhost:${1:3000}\" ," ,
36+ " \" webRoot\" : \"\\ ${workspaceFolder}\" " ,
37+ " }" ,
38+ " "
39+ ],
40+ "description" : " react chrome launch debug"
41+ },
42+ "react vite chrome debug" : {
43+ "prefix" : " debug-react-vite" ,
44+ "scope" : " json,jsonc" ,
45+ "body" : [
46+ " {" ,
47+ " \" name\" : \" react chrome launch\" ," ,
48+ " \" type\" : \" chrome\" ," ,
49+ " \" request\" : \" launch\" ," ,
50+ // 为了安装插件不与平时使用的chrome冲突,可以使用canary版本,就是chrome的开发者版本,",
51+ // 这个版本的更新速度很快,有最新的特性,也有最新的bug",
52+ // \"runtimeExecutable\":\"canary\",
53+ " \" runtimeArgs\" : [" ,
54+ // 默认打开chrome开发者面板"
55+ " \" --auto-open-devtools-for-tabs\" ," ,
56+ " ]," ,
57+ // 设置用户信息保存目录,这样方便安装插件,保存cookie等信息。",
58+ " \" userDataDir\" : \" D:\\\\\\ chrome-dev-userDataDir\" ," ,
59+ " \" url\" : \" http://localhost:${1:3000}\" ," ,
60+ // 这个是配置sourcemap映射的目录
61+ // 调试vite项目,webRoot设置一个不存在的目录,是为了热更新的代码断点不会打到本地文件上,因为热更的临时文件并没有本地文件,会导致断点在奇怪的位置
62+ // 配置以后断点就不会断住了
63+ " \" webRoot\" : \"\\ ${workspaceFolder}\" " ,
64+ " }" ,
65+ " "
66+ ],
67+ "description" : " react vite chrome launch debug"
68+ },
69+ "vue vite chrome debug" : {
70+ "prefix" : " debug-vue-vite" ,
71+ "scope" : " json,jsonc" ,
72+ "body" : [
73+ " {" ,
74+ " \" name\" : \" react chrome launch\" ," ,
75+ " \" type\" : \" chrome\" ," ,
76+ " \" request\" : \" launch\" ," ,
77+ // 为了安装插件不与平时使用的chrome冲突,可以使用canary版本,就是chrome的开发者版本,",
78+ // 这个版本的更新速度很快,有最新的特性,也有最新的bug",
79+ // \"runtimeExecutable\":\"canary\"
80+ " \" runtimeArgs\" : [" ,
81+ // 默认打开chrome开发者面板",
82+ " \" --auto-open-devtools-for-tabs\" ," ,
83+ " ]," ,
84+ // 设置用户信息保存目录,这样方便安装插件,保存cookie等信息。",
85+ " \" userDataDir\" : \" D:\\\\\\ chrome-dev-userDataDir\" ," ,
86+ " \" url\" : \" http://localhost:${1:3000}\" ," ,
87+ // 这个是配置sourcemap映射的目录
88+ // 调试vite项目,webRoot设置一个不存在的目录,是为了热更新的代码断点不会打到本地文件上,因为热更的临时文件并没有本地文件,会导致断点在奇怪的位置
89+ // 配置以后断点就不会断住了 ${workspaceFolder}\\aaabbb
90+ " \" webRoot\" : \"\\ ${workspaceFolder}\\\\\\ aaabbb\" " ,
91+ " }" ,
92+ " "
93+ ],
94+ "description" : " vue vite chrome launch debug"
95+ },
96+ // node --inspect-brk 进入调试并在首行断电,可以用chrome devtool调试
97+ "node launch" : {
98+ "prefix" : " debug-node" ,
99+ "scope" : " json,jsonc" ,
100+ // "program": "${workspaceFolder}/index.js",
101+ "body" : [
102+ " {" ,
103+ " \" name\" : \" node launch\" ," ,
104+ " \" type\" : \" node\" ," ,
105+ " \" request\" : \" launch\" ," ,
106+ " \" skipFiles\" : [" ,
107+ " \" <node_internals>/**\" " ,
108+ " ]," ,
109+ " \" program\" : \"\\ ${workspaceFolder}\\\\\\ index.js\" " ,
110+ // 第一行打断点
111+ // "stopOnEntry": true
112+ " }" ,
113+ ],
114+ "description" : " node launch debug"
115+ },
116+ "npm scripts launch" : {
117+ "prefix" : " debug-npm-scripts" ,
118+ "scope" : " json,jsonc" ,
119+ "body" : [
120+ " {" ,
121+ " \" name\" : \" npm scripts launch\" ," ,
122+ " \" type\" : \" node\" ," ,
123+ " \" request\" : \" launch\" ," ,
124+ " \" runtimeArgs\" : [" ,
125+ " \" run-script\" ," ,
126+ " \" ${1:debug}\" " ,
127+ " ]," ,
128+ " \" runtimeExecutable\" : \" npm\" ," ,
129+ // 集成到终端和平时开发无缝衔接
130+ // 缺点是 debug console是可以执行表达式获取值的,终端没有这个功能。
131+ " \" console\" : \" integratedTerminal\" ," ,
132+ " \" skipFiles\" : [" ,
133+ " \" <node_internals>/**\" " ,
134+ " ]," ,
135+ // 第一行打断点
136+ // "stopOnEntry": true
137+ " }" ,
138+ ],
139+ "description" : " node launch debug"
140+ },
141+ // 使用特殊变量实现调试当前文件
142+ // 适合调试单个js文件的案例
143+ "node launch current js" : {
144+ "prefix" : " debug-node-current" ,
145+ "scope" : " json,jsonc" ,
146+ "body" : [
147+ " {" ,
148+ " \" name\" : \" node launch current\" ," ,
149+ " \" type\" : \" node\" ," ,
150+ " \" request\" : \" launch\" ," ,
151+ " \" skipFiles\" : [" ,
152+ " \" <node_internals>/**\" " ,
153+ " ]," ,
154+ // 调试当前的文件
155+ " \" program\" : \"\\ ${file}\" " ,
156+ " }" ,
157+ ],
158+ "description" : " node launch debug"
159+ },
160+ "node launch current ts" : {
161+ "prefix" : " debug-node-current-ts" ,
162+ "scope" : " json,jsonc" ,
163+ "body" : [
164+ " {" ,
165+ " \" name\" : \" node launch current\" ," ,
166+ " \" type\" : \" node\" ," ,
167+ " \" request\" : \" launch\" ," ,
168+ " \" skipFiles\" : [\" <node_internals>/**\" ]," ,
169+ " \" runtimeExecutable\" : \" tsx\" ," ,
170+ " \" console\" : \" integratedTerminal\" ," ,
171+ " \" program\" : \"\\ ${file}\" " ,
172+ " }"
173+ ],
174+ "description" : " node launch debug"
175+ },
176+ }
0 commit comments