vscode-comment-translate icon indicating copy to clipboard operation
vscode-comment-translate copied to clipboard

请问能否自定义选中文本的格式,即对文本按照一定的规则再加工后再作为translator的input?

Open jnwang1 opened this issue 4 years ago • 2 comments
trafficstars

主要因为,一些注释里有< see xxx="xxxx">等的格式,我需要先用regex把它们过滤掉再放入翻译器,这样翻译会准确很多🤣

看了扩展的源码,并且尝试在server/src/Comment.ts里的getComment方法中通过对block.comment再加工实现这个需求,但保存后退出vscode再进入也并未有更新(做了很多实验也无法使任何改动生效),由于是刚接触typescript,请问我的实现逻辑有何问题吗?

jnwang1 avatar Nov 16 '21 11:11 jnwang1

很好的建议。 有这种跳过翻译支持,效果应该更好。

没有生效可能是没有做编译(npm run watch),可以看看vscode插件开发文档。 https://code.visualstudio.com/api/get-started/your-first-extension

intellism avatar Nov 17 '21 07:11 intellism

强烈建议增加此功能。我的需求是:为Multi Line Merge配置合并规则,可以是正则表达式之类的。不同编程语言注释的换行规则各不相同。如果增加此配置,将大大提高灵活性。

itheochan avatar Nov 22 '23 03:11 itheochan