gpt4 book ai didi

visual-studio-code - VSCode 扩展 : How to render colored output in output channel?

转载 作者:行者123 更新时间:2023-12-03 19:30:15 28 4
gpt4 key购买 nike

我有来自 API 的自定义输出,我想将其格式化为带有一些颜色值的字符串。

最佳答案

输出 channel 可以用 TmLanguage grammar 着色. Output Colorizer扩展扩展正是这样做的:



您可以通过定位 text/x-code-output 来做到这一点。模仿类型:

"contributes": {
"languages": [{
"id": "code-output",
"mimetypes": [
"text/x-code-output"
]
}],
"grammars": [{
"language": "code-output",
"scopeName": "code.output",
"path": "./syntaxes/code-output.tmLanguage"
}]
}

然而,由于这种着色是基于模仿类型的, you can't apply the highlighting to a specific output channel only .这意味着提供输出 channel 着色的两个扩展将发生冲突。

关于visual-studio-code - VSCode 扩展 : How to render colored output in output channel?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55524643/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com