如何在Visual Studio Code中添加通用语言片段? [英] How to add common language snippets in Visual Studio Code?

查看:89
本文介绍了如何在Visual Studio Code中添加通用语言片段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在正式的vscode文档中,我已经看到可以为每种语言创建自定义代码段。
https://code.visualstudio.com/Docs/customization/userdefinedsnippets

In official vscode documentation i have seen that is possible to create custom snippets for each language. https://code.visualstudio.com/Docs/customization/userdefinedsnippets

例如。 (languageId).json

但是如果我想定义所有语言通用的代码段?

But if i want to define snippets common for all languages? It is possible?

推荐答案

当前不支持普通用户代码段,但跟踪此功能请求的VSCode问题。请让我们知道这是否对您有用。

Common users snippets are currently not supported, but there is a VSCode issue tracking this feature request. Please let us know if this is something you would find useful.

出于完整性考虑, VSCode扩展程序可以为多种语言注册相同的代码段,但它们必须明确指定为其提供代码段的所有语言(是没有 language: * 选项)。

For completeness, VSCode extensions can register the same snippets for multiple languages but they must explicitly specify all languages they provide snippets for (there is no "language": "*" option).

这篇关于如何在Visual Studio Code中添加通用语言片段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆