[英]How can I hack the IntelliJ Idea Command-line Launcher script to open a file in an independent window and wait for close?
IntelliJ has a built in Command-line Launcher script that, by default on Mac OS, installs a Python file to /usr/local/bin/idea
. IntelliJ具有内置的命令行启动器脚本,默认情况下,在Mac OS上,该脚本将Python文件安装到
/usr/local/bin/idea
。 By examining this file, I was able to find a cool way to launch a file in it's own temporary project (ie, idea --temp-project myfile.txt
). 通过检查该文件,我找到了一种在其自己的临时项目中启动文件的绝妙方法(即
idea --temp-project myfile.txt
)。 What I'd like to do next, is find a way to wait on the project closing. 接下来,我想找到一种等待项目结束的方法。
Again, by examining the Python code, this would seem to depend (at least when IntelliJ is already open, which is my typical usage) upon a socket call activate ...
(line 88 in the script on my system). 同样,通过检查Python代码,这似乎取决于(至少当IntelliJ已打开时,这是我的典型用法)取决于socket调用
activate ...
(系统脚本中的第88行)。 At the top of the file, there's a comment that says see com.intellij.idea.SocketLock for the server side of this interface
which can be found here . 在该文件的顶部,有一条注释,指出
see com.intellij.idea.SocketLock for the server side of this interface
,可在此处找到。 Unfortunately, I can't seem to figure out the IntelliJ socket API from this file. 不幸的是,我似乎无法从该文件中找出IntelliJ套接字API。
Does anyone have a link to documentation or otherwise know a way to hack this, with the goal of basically waiting on the call until the temporary project is closed? 是否有人链接到文档或以其他方式知道破解此方法的目的,目的是基本上等待呼叫直到临时项目关闭?
Edit: I'm using IntelliJ Idea Ultimate 2019.1.3 on Mac OS Mojave 10.14.5 编辑:我在Mac OS Mojave 10.14.5上使用IntelliJ Idea Ultimate 2019.1.3
Command line launcher --wait
key is supported since 2019.2. 从2019.2。开始支持命令行启动器
--wait
键。 Running idea --temp-project --wait myfile.txt
should do exactly what you want: open a file, block cmdline until the file is opened in IDE. 运行
idea --temp-project --wait myfile.txt
应该完全符合您的要求:打开文件,阻止cmdline,直到在IDE中打开该文件。
NB: this does not work for Toolbox+Mac, as Toolbox creates incompatible launcher. 注意:这不适用于Toolbox + Mac,因为Toolbox创建了不兼容的启动器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.