简体   繁体   English

intellij的想法:终端窗口:使文件路径/文件可单击

[英]intellij idea: terminal window: making a filepath/file clickable

I'm implementing the Maven CPD PMD plug-in to to spot and (fail the build) if any instances of code duplication are presennt in the project. 我正在实施Maven CPD PMD插件以发现和(如果构建失败)项目中是否存在任何代码重复实例。

This all works fine. 这一切都很好。 However, The output error to the terminal in intellij idea is in the form: 但是,以IntelliJ想法向终端输出错误的形式为:

Terminal output: 终端输出:

CPD Failure: Found 31 lines of duplicated code at locations: CPD失败:在以下位置发现了31行重复的代码:

[INFO] C:\\Users\\bob\\Documents\\Project\\Folder\\src\\main\\java\\HelloWorld.java line 330 [INFO] C:\\ Users \\ bob \\ Documents \\ Project \\ Folder \\ src \\ main \\ java \\ HelloWorld.java第330行

[INFO] C:\\Users\\bob\\Documents\\Project\\Folder\\src\\main\\java\\HelloWorld.java line 428 [INFO] C:\\ Users \\ bob \\ Documents \\ Project \\ Folder \\ src \\ main \\ java \\ HelloWorld.java第428行

This works fine and how it should do, 这很好,应该怎么做,

although, I recently had experience implementing Maven Check Style plug-in, which output error looks like this : 不过,我最近有实现Maven Check Style插件的经验,该输出错误如下所示:

[INFO] C:\\Users\\bob\\Documents\\Project\\Folder\\src\\main\\java\\HelloWorld.java:428 [INFO] C:\\ Users \\ bob \\ Documents \\ Project \\ Folder \\ src \\ main \\ java \\ HelloWorld.java:428

This is infinitely more useful as I can just click on this "file path" and go directly to the file and line where this error occurs ie. 这无限有用,因为我只需单击此“文件路径”,然后直接转到发生此错误的文件和行即可。 HelloWorld.java at line 428. HelloWorld.java在第428行。

so, my question is, is there anyway of getting intellij idea to "recognise" the output in the form: 所以,我的问题是,是否有某种方式让intellij想法“识别”以下形式的输出:

[INFO] C:\\Users\\bob\\Documents\\Project\\Folder\\src\\main\\java\\HelloWorld.java line 428 [INFO] C:\\ Users \\ bob \\ Documents \\ Project \\ Folder \\ src \\ main \\ java \\ HelloWorld.java第428行

and making this "clickable" ?? 并使这个“可点击的”?

Any help or insights will be greatly appreciated as having to manually navigate to the class is really annoying :( (especially as I have hundreds of errors). 任何帮助或见解将不胜感激,因为必须手动导航到该类真的很烦人:((特别是因为我有数百个错误)。

Thanks all.. :) 谢谢大家.. :)

With Intellij can you run your code using a Run Configuration rather than using the terminal? 使用Intellij,您可以使用“运行配置”而不是使用终端来运行代码吗? This will give you what you want. 这会给你你想要的。

Also, as a comment, Visual Studio Code does exactly what you want out of the box. 另外,作为注释,Visual Studio Code确实可以满足您的要求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM