是否可以为vs代码编写二进制文件导入扩展名? [英] Is it possible to write a binary file import extension for vs code?

查看:72
本文介绍了是否可以为vs代码编写二进制文件导入扩展名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在vs代码中显示二进制文件的一些信息. 是否可以编写vs代码的扩展名,以便在资源管理器中选择该文件(或直接打开文件)时,您会看到该扩展名从二进制文件中提取的一些文本?

I want to display some informations of a binary file in vs code. Is it possible to write an extension for vs code, such that when selecting that file in the Explorer (or opening it directly) you see some text extracted from the binary file by that extension?

因此,该扩展程序的核心功能将是(简化)二进制到文本转换器.

So the core functionality of that extension would be (simplified) a binary to text converter.

有什么建议吗?

推荐答案

VS代码团队成员已确认他们不支持在

The VS Code team member has confirmed they do not have support for registering content providers for binary files in my issue.

我已经检查了workspace.onDidOpenTextDocument和window.onDidChangeActiveTextEditor API,但是打开二进制文件时似乎都没有调用.

I've inspected the workspace.onDidOpenTextDocument and window.onDidChangeActiveTextEditor APIs, but neither seems to be called when opening binary files.

是否可以使用registerTextDocumentContentProvider(或其他方式)显示回退内容的二进制文件?

Is there a way to display fallback content using registerTextDocumentContentProvider (or otherwise) for binary files?

这就是为什么这些类型都在名称,TextEditor,TextDocument等中都带有Text的原因.它们只能处理文本数据,而不能处理二进制数据;-)

That's why these types all carry Text in their names, TextEditor, TextDocument, etc. They can only handle textual, not binary data ;-)

没有解释为什么它适用于PDF(可能是特殊情况).

No explanation as to why this works for PDFs, probably special-cased.

这篇关于是否可以为vs代码编写二进制文件导入扩展名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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