JETBRAINS
Intro(Jetbrains) #
Jetbrains系列禁用macOS触控栏 #
由于在 debug 的过程中需要用到 Fn 系列功能,所以不要让软件自定义 touch bar 相关内容。
解决办法(局部软件级别):Help -> Editor Custom VM Options ->-Dide.mac.touchbar.use=false
, 参考 youtrack|Disable-touchbar-support。
当然还有另外一种方式,全局系统级别的禁用:系统设置 -> 键盘 -> 触控栏设置 -> 触控栏显示切换到其他即可。
上述局部方式好像啥也不显示了,要想显示Show F1, F2, etc. keys on the Touch Bar
, 参考 Show F1, F2, etcWebStorm文件内容不能预览(打不开文件) #
可能原因是新版本使用了老版本的插件,不兼容造成的原因。解决办法:
删除对应版本WebStorm中的plugins目录
。 参考 删除了额外的插件 目录Idea调试异常信息显示(Unknown Source) #
可能原因是当前使用的jar包在编译的时候没有加入调试信息,比如(
LineNumberTable
,LocalVariableTable
, etc. )
参考1:Why do I see unknown source in stack traces when I have sources downloaded?
参考2:bouncy castle: How to get bcpkix-jdk15on-1.47.jar with debug information 解决方案:version[-debug]Idea设置debug面板等宽字体 #
1). 因为需要对比debug内容,尤其是字节数组,所以设置
JetBrains Mono
等宽字体。
2). 设置debug面板 [参考],通过全局来控制或影响Settings | Appearance & Behavior | Appearance | Use custom font
。Editor或者console面板可以通过Settings | Editor | Font
,Settings | Editor | Color Scheme | Console Font
单独设置.Idea不能读取系统环境变量 #
原先因为调试IDEA启不动问题,手贱将idea启动目录下的一个C
/Applications/IntelliJ IDEA.app/Contents/bin/printenv
程序因为打印格式问题替换成了/usr/bin/printenv
(辛好有备份😝),导致IDEA读取不到系统设置的环境变量。效果类似如下图所示。但是好在有大佬们的文章 Env variables not sourced when launched from Mac OS X Monterey Dock可以借鉴,最终成功解决。Idea编码设置 #
Tip
默认情况下:使用idea创建的properties文件是
ISO 8859-1
编码格式(如果没有专门设置过的话)。
在使用中文的情况下,错误字符下面会有黄线警告,如果保存文件,使用其他十六进制查看的话,会是一个?
[0x3F] 乱码。
原因如下:使用ISO 8859-1
单字节编码保存了中文(多字节),不认识,所以插入?
,以表尊重。
还有另外需要注意的点:(java resource bundle,用于国际化的i18n)
不论文件的编码方式是ISO 8859-1
还是utf-8
,文件内容必须是 unicode 或者 ascii ,例如hello=\u9ed8\u8ba4\u5185\u5bb9
. 参考: Resource bundles must be created in ASCII, or use Unicode escape codes to represent Unicode characters. Since you don’t compile a property file to byte code, there is no way to tell the JVM which character set to use
如果需要编辑,可读,可以通过idea自带的Transparent native-to-ascii conversion
功能将unicode展示成可读文字(GBK|UTF-8)
如果已经存在可读文字(GBK|UTF-8),需要将其转化成unicode,可以使用JAVA_HOME/bin中的工具native2ascii
,
使用命令native2ascii -encoding UTF-8 messages_cs.properties messages_cs_escaped.properties
进行转换。Caution
UTF-8 is a multibyte encoding that can represent any Unicode character. ISO 8859-1 is a single-byte encoding that can represent the first 256 Unicode characters. Both encode ASCII exactly the same way. 参考
first 256 unicode char 参考 、ISO 8859-1 编码表 参考Reference #
- https://intellij-support.jetbrains.com/hc/en-us/articles/206544519-Directories-used-by-the-IDE-to-store-settings-caches-plugins-and-logs
- https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000113064-How-to-change-debugger-font-size
- https://stackoverflow.com/questions/66565398/why-do-i-see-unknown-source-in-stack-traces-when-i-have-sources-downloaded/66565466
- https://issuetracker.google.com/issues/216364005#comment7