intellij-rust / intellij-rust

Rust plugin for the IntelliJ Platform
https://intellij-rust.github.io
MIT License
4.54k stars 380 forks source link

Cannot exclude directories/files #6518

Open mahkoh opened 3 years ago

mahkoh commented 3 years ago

Environment

Problem description

In the "Mark Directory as" context menu, there is no button to exclude a directory.

2020-12-15-16:36:41

Directories can still be manually excluded by adding them to the iml.

According to Jetbrains support, the button should be there. And once manually excluded, there is a button there to undo the exclusion.

Kobzol commented 3 years ago

I also noticed this, I think that it has started to happen with 2020.3. Not sure if it's specific to the Rust plugin.

Undin commented 3 years ago

I think that it has started to happen with 2020.3

No, it just doesn't work in CLion for non C++ projects See https://youtrack.jetbrains.com/issue/CPP-13494

vlad20012 commented 3 years ago

It's possible to add the button from our side and the CLion lead said to me that it's ok if we add it

mahkoh commented 3 years ago

And are you going to do that?

tuck182 commented 2 years ago

And are you going to do that?

Great question. Is this possible?

Adding for those who might run across this issue: a workaround I've found that seems to be fine (so far) is to edit .idea/<project-name>.iml and add a line:

$ diff .idea/project-name.iml{.orig,}
--- .idea/project-name.iml.orig    2022-03-23 12:29:33.000000000 -0700
+++ .idea/project-name.iml 2022-03-23 12:22:12.000000000 -0700
@@ -4,6 +4,7 @@
     <content url="file://$MODULE_DIR$">
       <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
       <excludeFolder url="file://$MODULE_DIR$/target" />
+      <excludeFolder url="file://$MODULE_DIR$/excluded_folder_name_here" />
     </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
Andlon commented 1 year ago

I'm overall very happy with the Rust plugin, but this is easily the biggest issue that I have with CLion's Rust integration at the moment. While CLion insists on indexing tens of gigabytes of irrelevant simulation data, the IDE is effectively useless (even across several different open projects, since it keeps freezing other projects than the one being indexed) . Yes, it's possible to edit project-name.iml, but this doesn't work well when CLion has already started its indexing.

From an outside perspective, it is difficult to understand why a simple Right-click option to exclude directories from indexing has anything to do with the specific project type being worked on. It's confusing that this is not just available for any directory/file.

luxalpa commented 1 year ago

I have a dependency subtree'd in and it's a bit annoying to always see it in search results etc. Also I feel like it's eating up more memory than needed (not sure about this one though, but it's a big dependency).

Anivie commented 11 months ago

This problem is still not fixed, JetBrains there is no reply?

ctron commented 11 months ago

I have the same issue. And it's rather painful on some projects.

haoxuanpan commented 1 month ago

same here