vscode插件Better Comments的Fortran支持

VScode Better Comments的Fortran语言支持

better comments插件不用过多介绍了,网上的推荐和说明有很多。但是最近使用的时候发现对上古语言Fortran的自由格式写法“!”注释不支持。费了一番功夫,在GitHub上找到了大佬的解决办法:https://github.com/aaron-bond/better-comments/pull/186在提问中作者给出了解决方案,原文是:

The best solution would be for someone with write access to this repo to merge this branch and publish a new version of the extension, but for some reason this has yet to happen.

You could go and manually edit parser.js, where the extension is installed, with the code that I added in parser.ts but beware that if you have extension syncing enabled these changes will be overwritten whenever the extensions are synced with your GitHub/Microsoft account. So really the only solution is for @aaron-bond to merge this to master.

@Arsennnic one more thing I should probably point out about this extension and Fortran code is that !! in Fortran is used by default in Doxygen documentation as continuation characters. Using this extension with Doxygen-styled docstrings will cause them to be highlighted in bright red, which can be a bit annoying for some.

大概就是说找到better comments安装位置中的parser.js文件,找到类似一堆case的片段,然后把以下的内容(在上述GitHub链接中抄的)加进去:

case "FortranFreeForm":
	this.delimiter = "!";
	break;

case "fortran_fixed-form":
	this.delimiter = "!";
	break;

然后重启一下vscode就真的可以了!亲测有效
当然原作者也说了,如果你有开启自动同步,那么如果其他设备上没有这样改的话同步之后你自己做的修改会被覆盖掉。这么小儿科的bug不知道better comments的开发团队为什么不听话把它merge到master里面去!
Anyway, 感谢GitHub上这位老哥,祝诸位苦逼的Fortraner好运。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值