简体   繁体   English

在eclipse中关闭intellij想法中未使用的模块

[英]Closing unused modules in intellij idea like in eclipse

As I know for now there is no any feature to do that in intellij idea. 据我所知,目前在intellij的想法中没有任何功能。 I dont know why but they dont support to do that, at least this is the result which I found with all my researching. 我不知道为什么,但他们不支持这样做,至少这是我在所有研究中发现的结果。 Maybe some of us manage this problem with different ways. 也许我们中的一些人以不同的方式处理这个问题。 How do you work with multiple modules in intellij? 你如何使用intellij中的多个模块? How should I increase the performance while working with multiple projects? 在处理多个项目时,我应该如何提高性能?

Closing unused modules in intellij idea like in eclipse? 在eclipse中关闭intellij想法中未使用的模块?

You can make that module directory as excluded from that project. 您可以将该模块目录设置为从该项目中排除。

Right clicked on the directory, then goto Mark Directory As -> then click Excluded it 右键单击该目录,然后转到Mark Directory As - >然后单击Excluded it

To Add a module back, click on Project Structure button, then goto Modules section, then you can add them back 要重新添加模块,请单击“ Project Structure按钮,然后转到“ Modules部分,然后将其添加回来

在此输入图像描述

The Offline Module plugin let you disable or enable modules in project without deleting. 脱机模块插件允许您在项目中禁用或启用模块而不删除。

Click Disable Module in context menu in Project View, it disables the selected modules. 单击“项目视图”中上下文菜单中的“ Disable Module ”,它将禁用所选模块。 Disabled Modules are shown in a group and can be add back by Load Module . 已禁用的模块显示在一个组中,可以通过Load Module添加回来。

In Intellij 2017.2, you can easly load/unload modules or groups of modules : 在Intellij 2017.2中,您可以轻松加载/卸载模块或模块组:

  1. Right click in the "Project" view 右键单击“项目”视图
  2. Select "Load/Unload modules" 选择“加载/卸载模块”
  3. Select modules to load/unload and click OK button 选择要加载/卸载的模块,然后单击“确定”按钮

加载/卸载模块截图

Warning : This is an "experimental" feature 警告:这是一个“实验性”功能

Ref : jetbrains site 参考: jetbrains网站

Projects in Eclipse are Modules in IntelliJ . Eclipse中的项目是IntelliJ中的模块 I do not recommend using them the same way - ie importing unrelated projects as modules into one IntelliJ project. 我不建议以相同的方式使用它们 - 即将不相关的项目作为模块导入一个IntelliJ项目。

Importing for example database project and application project into one is ok, or when working on one project means working on another. 例如,将数据库项目和应用程序项目导入到一个是可以的,或者在一个项目上工作意味着在另一个项目上工作。 But when you import too many projects into one, you will have a problem with searching and "Go To File/Class" actions, and you will use too much heap space. 但是当您将太多项目导入其中时,您将遇到搜索和“转到文件/类”操作的问题,并且您将使用过多的堆空间。

Generally, when you have a lot of opened projects, there are three problems 通常,当您有大量已打开的项目时,有三个问题

  • too much used heap -> GC pauses. 使用过多的堆 - > GC暂停。
  • switching between them is hard 在它们之间切换很难
  • closing and reopening a lot of projects is hard 关闭并重新开放很多项目很难

To solve this, I have made Frame Switcher plugin for easier switching between projects, and reopening closed ones. 为了解决这个问题,我制作了Frame Switcher插件,以便更轻松地在项目之间切换,并重新打开已关闭的项目。 Also, when you have 32 bit Windows and have too many projects, then you need to start new IntelliJ instance, and Frame Switcher can integrate them. 此外,当你有32位Windows并且项目太多时,你需要启动新的IntelliJ实例,而Frame Switcher可以集成它们。

There is also Missing Functionality plugin which lets you "Close All Other Projects". 还有Missing Functionality插件 ,可以让你“关闭所有其他项目”。

Since the old "Offline Module" doesn't work, I made a plugin to utilize the mechanics of "Mark as Excluded" to quickly show/hide multiple modules. 由于旧的“离线模块”不起作用,我制作了一个插件来利用“标记为排除”的机制来快速显示/隐藏多个模块。

Link to module here: https://plugins.jetbrains.com/plugin/7803?pr=idea 链接到模块: https//plugins.jetbrains.com/plugin/7803?pr = aidea

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

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