Is it possible to configure IntelliJ to not index specific files? - intellij-idea

Scripts and styles for the project I'm working on get compiled and minified into single (enormous) files when the project is built. When IntelliJ goes to index everything, it spends a significant amount of time indexing the minified files, which are all but useless for the purpose of searching.
Is there a way to ignore specifically these files, and not just a directory?

I'm taking mostly a guess here, IntelliJ docs are notorious for being not-so-helpful on some topics.
Try marking the files as plain text:
When a file is marked as plain text, IntelliJ IDEA does not use it anymore for code completion and navigation...The reverse action is also available: you can return a file to its original type, using the Mark as action
Edit: After hearing that your files are dynamically created, I think I may have figured out a solution.
IntelliJ allows for the creation of Scopes, which allow you to exclude certain files from the project. You can then go to Editor -> Inspections and change the scope of each inspection from All Scopes to your new scope

Related

How to make IntelliJ IDEA keep package prefixes for source folders after reimport?

For some projects the standard directory layout module/src/main/scala/com/company/project/module may be an overkill and can be flattened to module/src. I work with the scala language which doesn't force packages to be equal to file paths. IDEA will be unhappy, complain that a package doesn't correspond to a file path, create new classes with wrong packages and so on. To fix that I can specify package prefix for source folders and then it will work fine. However those prefixes are lost on project reimport (from SBT). Can I make IDEA keep them?
sbt-idea plugin has ideaPackagePrefix property. See also the related feature request.
More details can be found here.

IntelliJ: generate a JAR but do *NOT* including dependencies

In a simple IntelliJ module, I just want to generate a .jar file with my .class files, via IntelliJ IDE commands.
Please be careful before marking this as a "duplicate":
Although I've seen Google and Stack hits with promising titles, I'm not finding a really good answer, or the title is misleading, or its an unanswered question. I cover one possible answer that I've seen before (below), and why I don't think it's a match.
I've used Eclipse in the past, but I'm rather new to IntelliJ.
I've worked with the "Project Structure / Artifacts" stuff. I can generate the giant jar, similar to using "shade", but it's huge because it includes all the nested dependencies. We want the small jar with just this module's class files because the system we're deploying to already has all the other jars in place.
I've seen some references to changing a target directory in the Artifacts dialog box, but it then talks about references being made in the Manifest file, which I don't want. The destination environment already has its java paths setup, so I'm worried that having jar references in this jar will mess that up. If this really is the answer then I'm confused about how it works.
Constraint 1: Can't use command line tools, since I'm actually walking somebody else through these steps, who likely doesn't have command line tools installed in the path, or wouldn't know how to use them, etc. They're not a coder. (Yes, I know this sounds like an odd scenario; I inherited this situation.)
Constraint 2: We want to keep this as a simple IntelliJ project, vs. converting to Maven or Ant or Gradle, etc.
Coworker had the fix.
Short Answer:
Remove all of the other jars/libraries from Output Layout tab of the Artifacts config dialog.
Longer Answer:
You still do File / Project Structure...
Then in the Project Settings, click Artifacts.
And then you still click the plus button (second column) ti create a new artifact setting.
The trick is the "Output Layout" tab in the third column of the window. Highlight all entries EXCEPT the compiled output of your project and delete all those other entries (click the minus button under that tab, directly above your_project.jar)
On my laptop this causes it to pause for a few seconds; I thought it didn't do anything, then finally it reflected that everything was gone except "'my_module' compile output"
Also check the "Build on make" (for when you later do Build / Rebuild Project)
If you need both a full jar and a slim jar, you can have more than one Artifact configuration with different names, and they will default to different output directories.

Restrict Intellij IDEA backward analysis

I'm trying to analyze one Maven module of a Java project in Intellij IDEA using the Analyze->Inspect Code menu item. I have restricted the scope of the analysis to that project. When it runs the analysis, it gets to a phase called "Perform Backward Analysis" where it is looking at files outside of the module I ran the analysis on. Specifically, it is running the analysis on a large number of XML and HTML files that are used as part of the help documentation of the project and are not related to the code.
At the rate it is going, it is probably not going to finish the analysis this decade, so how do I either get Intellij to really only look at the files in the current directory, or turn off backward analysis, or exclude the XML/HTML files from the backward analysis so that it eventually finished?
When you go to Analyze->Inspect Code, the dialog gives you the option to limit to the "Current file" or the module that is active in the editor when you invoked it. You can also define a custom scope such as just java files or files in a particular package.. Click on the button with the ellipsis. In the dialog, click the help button for the syntax for defining scopes.
You can create a custom scope to do this. If you have a look at the custom scope dialog you'll find an option to exclude selected paths, or you can simply type a pattern, such as !*..*.xml.

Emacs equivalent of Xcode's "Open Quickly"

I'm trying to get a Cocoa development environment working in Emacs, and I'm 80% of the way there. The one feature I miss is Xcode's "Open Quickly", which basically performs a fuzzy match of the string you type against the filenames referenced in the Xcode workspace and the symbols defined in those files.
My problem is that our project is huge: if I generate a TAGS file using etags for the .h and .m files in our project's sub-directories, the result is over a gig in size and Emacs complains "TAGS file is large. Really open?", and if I say yes, then Emacs hangs and becomes essentially unusable. Of course, this is before I've even considered indexing tags for system libraries. I've also tried projectile, but unfortunately it's similarly unusable on a project of my size (on the order of a full minute to find a match).
It occurs to me that all the indexing information I really want is in the Xcode projects themselves, so if I had an Emacs package that could parse them and traverse their dependencies, that might be a start, but I'm not aware of any such package.
Any suggestions/solutions in this respect?
I've never found a single function quite as convenient as Xcode's "Open Quickly", but these days I use
helm-projectile-git-grep when I want to match on strings I know to be in the filenames, and
helm-git-grep for quick searches through the contents of the files themselves.
I've found that this gets me really close to what I wanted in my original question.

How to add to project additional files not intended to be compiled?

I would like to add into project some files that shouldn't be compiled. I mean mainly text files with for example notes, concepts, comments etc.
I realized that it is possible only at module level. But it is not very convenient. I'd rather prefer to keep them on project level. Is it possible in any way?
And if not:
I have another idea: to create special module, name it for example "other_stuff", do not create src directory and put files there. Is it ok? I'm afraid of potential compilation problems when one of modules is artificial, with no sources but still has sdk assigned (it is probably impossible to leave module without sdk assigned).
While generating artifacts you can add any file into your artifact. Also, in modules you can have folders not declared as source, and they will not be compiled.