JetBrains Idea: exclude package & classes from autocomplete - intellij-idea

How can I exclude some classes from autocomplete, but not from project?
I'm trying to develop on flash with starling library. The problem is that IDE always suggest me a built-in classes, which I probably don't want to use, even if I import another class.
http://monosnap.com/image/7VRQpIhqIPRK2wgBKp41GOU9i
I'm tried to exclude in a Settings -> Editor -> Auto Import, but it takes no effect on a autocomplete.
May be I can reorder autocomplete suggest, for placing the libraries classes on top?
I'm using idea 12.0.4

Does Settings -> Editor -> Auto Import -> Exclude from Import and Completion help you?

Now in Preferences | Editor | General | Auto Import

There are instructions at https://www.jetbrains.com/help/idea/auto-completing-code.html for disabling, but they didn't work for me until invalidating caches and restarting.
Pull up autocomplete, highlight the offending item, then option-return and exclude it, either at the class or method level. Then invalidate caches and restart.

Related

IntelliJ Remove Unwanted Modules/Packages from Packages View

I am potentially fat fingering a hot key in IntelliJ and cannot figure out how to restore the default Packages View in the Projects Tool Window. My packages view will change from the default view:
io.xxx.yyy
MyClass.java
to
io
com.android.tools.idea.observable.core
cucumber.cucumberexpressions
flutter
grpc
xxx.yyy (the package I am working on)
.... and a lot of other modules/packages I do not want to see
Does anyone know the setting (or the hotkey) that I need to reset to get back to the default packages view - and remove all the excess modules, libraries, SDKs from the view? If you also know what HotKey I may be fat fingering so I can disable it - that would be awesome as well.
I have found some information in the IntelliJ Manual - it states that in the Packages View it does not display Modules, SDKs, and Libraries by default... which is awesome and what I want... I just need to figure out how to get back to this default view.
Per Jetbrains support - this is a bug. The workaround that is working for me is to disable the Kotlin plug in (Files -> Settings -> Plugins)... The support person stated that the bug should be fixed in 2021.1 ... Attaching screenshot of some of the packages that show up - they all appear to be empty.
Screenshot of Package View

Intellij Flutter - Import via Alt+Enter not working

My team members and me often face the problem in Intellij that we cannot import some classes via Alt+Enter because Intellij hasn't indexed them successfully.
Our set up
We have different Flutter projects which belong and work together.
ProjectFolder:
our_project/customer_app
our_project/provider_app
our_project/server_app
our_project/model_app
Some of these projects have dependencies to other projects which are declared in the pubspec.yaml file.
Problem
E.g. the customer_app has a dependency to the model_app.
Now we add this new class in model_app such as class MyModel.
Later in the process we want to use MyModel inside of the customer_app.
If we type something like MyModel() and try to press Alt+Enter it doesn't find the class immediately. (it works miracously only sometimes)
What we have to do then is to copy the path of MyModel and do the import manually. Which is often time consuming.
We even tried to run flutter packages get which also doesn't help to find this import of MyModel. Ideally we want that Intellij find the import automatically by indexing it without copying the path out of the other project.
This is a known issue and planned to be fixed eventually.
You can upvote https://github.com/dart-lang/sdk/issues/25820

IntelliJ autocomplete partially working

I've just added some Java classes to my project in IntelliJ IDEA 2017.2.3. When I attempt to use autocomplete to add the elsewhere in the project, it does not find them. It shows older classes, but not the new classes. If I type out the class name, IntelliJ asks to import it and everything works.
What am I missing? Why would if find some of my classes and not others?
Not the end of the world, but it is very annoying.
Well, I just discovered the invalidate cache option. This appears to have fixed the issue, by forcing a re-index.
For anyone else facing this problem, the option is under File -> Invalidate Caches / Restart...

How do I make my modified Intellij 'intention' available to my colleagues?

I have modified an Intellij 'intention'. (I changed the initialization of the JUnit test class).
How do I make this available to other members of my organization? We are all working on the same Intellij 'project', but I believe that these changes are on a per-user, not per-project basis. (If there is a way to make the changes apply only to one project, I would prefer that).
File | Export Setting / File | Import Settings.
Are more robust way would be to use the Settings Repository plug-in.
Templates are stored in the %CONFIG% directory, fileTemplates subdirectory.
To export the file, you set the 'Schema:' pulldown in the upper right corner of 'Settings->Editor->File and Code Templates->Code tab' to 'Project' This will cause IDEA to create a folder PROJECT/.idea/fileTemplates/code, and put your modified file there. Details are in:
https://www.jetbrains.com/help/idea/2016.3/file-and-code-templates.html#d2040410e142

How to prevent IntelliJ IDEA from deleting unused packages?

I'm working with intelliJ and my problem is when I start to import some temporary unused packages into my class file intellij delete those line within a second.
how can I turn off this not so nice feature?
Disable File | Settings | Editor | General | Auto Import | Optimize imports on the fly.
Normally you don't need to add imports manually, IDEA does it for you.
For Scala developers: you can have enabled
Settings > Editor > General > Auto Import > Optimize imports on the fly
but add exclusions into
Settings > Editor > Code Style > Scala > Imports always marked as used:
In Intellij 14 :
Settings > Editor > General > Auto Import > Optimize imports on the fly.
(Update)
For the Scala developers out there, you can have 1/2 the cake and eat the other 1/2 now: disable the auto-optimize for just scala
For me while using Go, this was caused by optimizing imports on save. IntelliJ IDEA -> Prefernces -> Tools -> Actions on Save -> Optimize imports.
The above answers are obviously the way to go. Here's another quick fix (a bad one at that) is to simply use it somewhere in your code
if (0) console.log(LibraryName.version);
This should only be a temporary measure though.