IntelliJ autocomplete partially working - intellij-idea

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...

Related

Intellij issue with "Command" groovy class

I have a grails domain class called "Command.groovy", which isn't being picked up by intellij as a domain class, for any and all purposes (such as highlighting that class or importing it in files, it says it's not found).
However, my code still compiles and works.
I tried looking online about this issue but haven't found anything about this.
Thanks #CrazyCoder, I found the answer where you mentioned.
The problem was the file was mapped to auto detect file type by content for some reason. (Found in settings->file types->Auto-detect file by content)

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

Bug in importing project code classes in android studio 3.0

So, say I have this code,
And then, normally, if I want to import that class, i just hover on the red-coded code (in this case MenuType), and press Alt+Enter. But, annoyingly, instead of importing the class, it turns into this:
And it's error.
To make it work, I need to manually insert the supposed-to-be-imported package into the import section, and it works normally. It's workable, but kinda annoying.
This however, work normally with non-project code (classes in dependencies, etc)
Anyone knows what caused this and how to fix it? Maybe it's because of Kotlin?
P.S. I think I didn't find this kind of bug in Android Studio prior to 3.0

mogenerator doesn't generate the files

I've just installed mogenerator using one of tutorials. I have added run script to my new target, and clicked Cmd+B. I should get some new files, but i didn't. In my .xcdatamodeld i have 2 entities (User and Repos). Below you can find my print screen of my project.
Where is the problem in my thinking? What should i do more? Please, help me, because i haven't found the solution on the web yet.
This all looks fine (judging by your screenshot).
One thing to check - which caused me the same issue - is that, when you've created your Entities in the xcdatamodelId file, make sure that you click on the Data Model Inspector icon, and that each entity has a Name value, and a matching "Class" value.
Miss out the Class name, and nothing will get generated.
Btw, when you click on Build, do you get a "Build succeeded" message ?
Here's the tutorial I followed to get mogenerator working:
RaptureInVenice
I should say, I've used mogenerator in a few projects, and this command line bit is always the piece that gives me trouble. Sometimes, I have to select my xcdatamodelId file, and create a new Version of it, before mogenerator will use it. But once it is working, it's a blessing.
Anything to avoid having to use the needlessly over-complicated CoreData stuff.
Someone should remind Apple that it's 2014...

Intellij idea deprecated no strikeout/strikethrough

I'm using IntelliJ IDEA v12. When I import a project, there’s a strikeout/strikethrough line on the method which has the annotation #Deprecated, but I used alt+enter to disable it. So, how can I reactivate this feature? I want to display that strikethrough, thanks!
Open Settings -> Type Inspections to go to inspection settings -> Type Deprecated to find out all deprecated related inspection settings -> Check Deprecated API usage.
IntelliJ had a bug in 2018.3, 2018.2.2 (182.4129.33). It was fixed in builds 191.65, 183.3691.
Setting -Dide.text.effect.new.metrics=false in the .vmoptions fixes the problem.
In addition to Ionghua's answer .....
If you find that IntelliJ is still not striking out deprecated methods, even though you have enabled the inspection as above, check to make sure that your code is not ignoring deprecation warnings with #SuppressWarnings("deprecation").
In addition to longhua's answer... and vegemite4me...
Another possible source for this problem might be custom color themes.
If you are using a custom theme, make sure that it contains strikethrough. I was using monokai-sublime and there is no strikethrough for #Deprecated annotations. When I changed the color theme from monokai to darcula strikethrough worked as expected.
I found that the only thing that worked for me with version 2019.2 192.5728.98, runtime 11.0.3+12-b304.10 was to use Help | Edit VM Options and add -Dide.text.effect.new.metrics=false