douzhuozhu9544 2015-03-13 09:54
浏览 73

设置特定宏仅在IntelliJ上针对某些文件扩展名运行

I have a macro on IntelliJ that format the code then save:

formatted save

I have assigned keyboard shortcut Ctrl+S to that macro:

assigned shortcut

This works well for css, js, and html.

The problem is, the built-in go-lang-idea-plugin gives different result from gofmt (formatter program that called by my auto-reload/auto-recompile program gin that runs when the sources changed/saved on disk) so the ReformatCode command for .go source code is useless.

How to disable that macro only for .go file? So when I save using Ctrl+S, it only do SaveAll?

  • 写回答

1条回答 默认 最新

  • douzhi2988 2015-03-13 11:30
    关注

    Try using the File Watcher plugin instead of macros to solve this issue: https://github.com/go-lang-plugin-org/go-lang-idea-plugin/issues/1324#issuecomment-75263115

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题