当前位置: 首页 > news >正文

南京做网站开发 待遇石家庄seo网站管理

南京做网站开发 待遇,石家庄seo网站管理,政府门户网站建设的现状,汨罗网站seo一目了然 1 简述2 设置模板3 Global Snippets file示例 1 简述 问:为什么要设置代码模板? 答:编程语言是有个性的,不同语言的演讲风格是不一样的。 旁白:我不懂?! 问:为什么要设置…

一目了然

  • 1 简述
  • 2 设置模板
  • 3 Global Snippets file示例

1 简述

问:为什么要设置代码模板?
答:编程语言是有个性的,不同语言的演讲风格是不一样的。
旁白:我不懂?!

问:为什么要设置代码模板?
答:同种语言的演讲内容是不一样的,但是演讲稿的框架可以是一样的。
旁白:我懂了?!

问:为什么要设置代码模板?
答:好吧,我承认,每次复制粘贴的操作也是相当费键盘的,我需要快捷的方式在不同格式的语言文件中填充不同的框架内容。
旁白:VSCode说它可以。

2 设置模板

点击VSCode界面左下角的齿轮图标,在弹出界面中点击“User Snippets”选项,如下图所示:

Manage -> User Snippets

此时会在界面顶部弹出选项,供用户选择需要为哪种语言添加模板,如下图所示:

Language Snippets

选择你要添加的模板语言,然后就可以在模板文件中添加自定义的文件模板了,需要注意的是模板文件的格式为“json”格式。

也可以创建一个“Global Snippets file”模板文件,在这个文件中可以为各种语言添加文件模板。

3 Global Snippets file示例

下面的代码展示的是一个“Global Snippets file”示例:

{// 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"// }"C function file template": {"prefix": "cfile","body": ["/**"," * CONFIDENTIAL and PROPRIETARY"," *   Copyright (c) XXX Automotive System Co.,LTD. All rights reserved."," *"," * FILE INFORMATION"," *   FILE NAME: ${TM_FILENAME}"," *   AUTHOR(S): XXX"," *"," * BRIEF INFORMATION"," *   function file."," */","","/*---------------------------------------------------------------------------"," *         Header Files"," *---------------------------------------------------------------------------*/","","/*---------------------------------------------------------------------------"," *         Local Defines"," *---------------------------------------------------------------------------*/","","/*---------------------------------------------------------------------------"," *         Local Variables"," *---------------------------------------------------------------------------*/","","/*---------------------------------------------------------------------------"," *         Global Variables"," *---------------------------------------------------------------------------*/","","/*---------------------------------------------------------------------------"," *         Local Functions"," *---------------------------------------------------------------------------*/","/**"," * Abstract:"," *   Function."," *"," * Parameter:"," *   argc: Parameter."," *"," * Return:"," *   None."," */","","/*---------------------------------------------------------------------------"," *         Global Functions"," *---------------------------------------------------------------------------*/","/**"," * Abstract:"," *   Function."," *"," * Parameter:"," *   argc: Parameter."," *"," * Return:"," *   None."," */","",""],"description": "C function file template."},"C header file template": {"prefix": "hfile","body": ["/**"," * CONFIDENTIAL and PROPRIETARY"," *   Copyright (c) XXX Automotive System Co.,LTD. All rights reserved."," *"," * FILE INFORMATION"," *   FILE NAME: ${TM_FILENAME}"," *   AUTHOR(S): XXX"," *"," * BRIEF INFORMATION"," *   header file."," */","","#ifndef _${TM_FILENAME_BASE/(.*)/${1:/upcase}/}_H_INCLUDED_","#define _${TM_FILENAME_BASE/(.*)/${1:/upcase}/}_H_INCLUDED_","","/*---------------------------------------------------------------------------"," *         Header Files"," *---------------------------------------------------------------------------*/","","/*---------------------------------------------------------------------------"," *         Defines"," *---------------------------------------------------------------------------*/","","/*---------------------------------------------------------------------------"," *         Types"," *---------------------------------------------------------------------------*/","","/*---------------------------------------------------------------------------"," *         Exported Functions"," *---------------------------------------------------------------------------*/","","","#endif  /* End #ifndef _${TM_FILENAME_BASE/(.*)/${1:/upcase}/}_H_INCLUDED_ */",""],"description": "C header file template."},"GTest function file template": {"prefix": "gtest","body": ["/**"," * CONFIDENTIAL and PROPRIETARY"," *   Copyright (c) XXX Automotive System Co.,LTD. All rights reserved."," *"," * FILE INFORMATION"," *   FILE NAME: ${TM_FILENAME}"," *   AUTHOR(S): XXX"," *"," * BRIEF INFORMATION"," *   unit test file."," */","","/*---------------------------------------------------------------------------"," *         Header Files"," *---------------------------------------------------------------------------*/","#include <stdio.h>""#include <stdlib.h>""#include <gtest/gtest.h>""/* Include C-format header file. */""extern \"C\" {""    #include \"\"""}","","using namespace std;","/*---------------------------------------------------------------------------"," *         Defines"," *---------------------------------------------------------------------------*/","","/*---------------------------------------------------------------------------"," *         Variables"," *---------------------------------------------------------------------------*/","","/*---------------------------------------------------------------------------"," *         Functions"," *---------------------------------------------------------------------------*/","/**"," * Abstract:"," *   Function."," *"," * Parameter:"," *   argc: Parameter."," *"," * Return:"," *   None."," */",""],"description": "GTest function file template."},"Python file template": {"prefix": "pyfile","body": ["# CONFIDENTIAL and PROPRIETARY","#   Copyright (c) XXX Automotive System Co.,LTD. All rights reserved.","#","# FILE INFORMATION","#   FILE NAME: ${TM_FILENAME}","#   AUTHOR(S): XXX","#","# BRIEF INFORMATION","#   file information.","","# Import modules or packages.","",""],"description": "Python file template."},
}

在上述代码中供定义了四种文件模板:

  • cfile: C语言源码文件模板
  • hfile: C语言头文件模板
  • gtest: GTest源码文件模板
  • pyfile: Python文件模板

当为VSCode添加了上述“Global Snippets file”内容后,在空白文件中就可以通过输入提示词(cfile,hfile,gtest,pyfile)然后点击回车按键填充文件了。

http://www.hkea.cn/news/116639/

相关文章:

  • 中小型网站建设服务淘宝数据分析工具
  • 梧州网站设计企业网站模板建站
  • 行政事业单位网站建设建议营销策划公司
  • 网络推广网站怎么做百度联盟广告点击一次收益
  • wordpress居中样式宁波seo网络推广外包报价
  • java做网站用到哪些技术网络营销的重要性与意义
  • 网络营销推广的作用谷歌seo什么意思
  • 免费网站建设解决方案郑州网络营销公司哪个好
  • 转转怎么做钓鱼网站税收大数据
  • 株洲专业网站排名优化深圳产品网络推广
  • 深圳美食教学网站制作如何免费搭建自己的网站
  • 兰州移动端网站建设广东整治互联网霸王条款
  • 彩票网站该怎么建设天津seo实战培训
  • 原平的旅游网站怎么做的新冠疫情最新情况最新消息
  • 网站开发软件著作权归谁seo外包
  • 小说网站的网编具体做哪些工作南宁网站快速排名提升
  • 承德网站设计seo互联网营销培训
  • 工信部网站备案查询 手机seo专员的工作内容
  • 淘宝活动策划网站视频营销成功的案例
  • 精准营销数据杭州排名优化软件
  • 中卫网站建站设计seo学习论坛
  • wordpress初始登录seo排名赚app靠谱吗
  • 软件外包保密协议seo相关岗位
  • 后台网站开发文档下载班级优化大师app
  • 辛集城乡建设管理局网站网络营销网络推广
  • 阿里云部署一个自己做的网站吗电商网站搭建
  • 免费汽车租赁网站模板网站域名解析ip查询
  • 企业解决方案官网国内seo排名分析主要针对百度
  • 变态版手游石景山区百科seo
  • 阿里云控制台登录入口seo矩阵培训