Kotlin Completion Dialog Popup after Typing "object." - intellij-idea

I'm starting to use Kotlin for writing tests and coming from Java I'm used to a completion dialog when typing "." after an object. Like this:
Doing the same thing using Kotlin does this:
Even hitting Ctrl + Space doesn't work:
I only start to get suggestions when I start typing the first few letters of a function that I know exists. Example:
Does anyone know how I can get Kotlin auto-complete working like Java?
I'm using the following version of IntelliJ IDEA on Ubuntu Linux with Oracle Java 8.

I solved the problem by navigating to File -> Invalidate Caches / Restart and pressing "Invalidate and Restart"

Related

Intellij Plugin Completion exits on dot?

What I wanna achieve?
When the Completion list shows up, my code will map all the language files located in .neon files and show them as auto complete text.
What I have done?
I restricted the completion to only show up when your caret is in between double quotes or single quotes
Issue
When I start typing it works as expected
But as soon as I type the dot character it miss behaves
I need the completion list to look up my whole string I wrote, not only those after the dot character
As a really bad workaround is to don't write the dot character
Can it be done somehow?
Okay, i got it. This is a default behavior of intelliJ where i was testing it.
After opening and testing the plugin in a proper intelliJ Ultimate instance. It works by default. I don't know why the sandboxed version has porblems with it.

Automation for terminal commands input in IntelliJ IDEA-family IDEs?

If frequently input similar commands in IDE's terminal, can I automate it somehow?
For example, I use PhpStorm and frequently create MVC-controller in Laravel framework by console command like php artisan make:controller CotrollerName. The ideal that I want:
Some simple action like shortcut pressing
Modal window "Please, input controller name".
Pressing Enter
Then IDE will automatically input php artisan make:controller InputtedCotrollerName to console and run it.
What is currently possible instead of this?
I think you overcomplicate things, simple alias would be better for this, like:
alias pamc='php artisan make:controller '
which then you can use in PHPStrorm by opening embedded terminal (Alt + F12 by default) and typing pamc ControllerName
As seems like you use Laravel you could consider using the Laravel plugin for PhpStorm. Which should provide most of the functionality you want, and a bit more.
Or
you can do what streetturtle suggested and create alias. They can save lots of writing time.

Alt+Enter does not work properly IntelliJ [duplicate]

When working with IntelliJ on a JavaProject it shows to use alt + enter to import a class for example, but this isnt working anymore. It worked in the past, but something must have changed, -the shortcut is still set,-other shortcut would work- i cant assign alt+enter manually, although if i reset it to default it gets set to it, any ideas how to fix my problem? btw my keyboard layout is german, but i dont think it is the problem because it worked in the past, my os is win 7. edited: when i am working within the IDE and i e.g. write Arrays.toString(a); and didn't import "java.util.Arrays" yet, the IDE says: " ? java.util.Arrays? Alt+Eingabe"    (Eingabe = Enter in German) so when i assign a different shortcut it works, but with Alt+Enter it doesnt thanks in advance for any help.
"Well, it means IDE doesn't see the shortcut for some reason. Probably it's already used by some other application or the operating system. – CrazyCoder 25 mins ago "
i closed all applications and it turns out that, Facebook GameRoom, running in the background, somehow is the reason the shortcut doesn't work, i have no idea why, but thats the solution
many thanks to CrazyCoder
It was working earlier but it stopped working due to unknown reason,
One workaround is Try fn+Alt+Enter
I had the same problem
and it turned out to be the keyboard language in Windows, It wasn't english,
so just make sure you are on English
On my side, culprit is some VPN software called PulseSecure
fn + Alt+Enter+Shift worked for me (credits #ketankk).
My problem solved. just try :
LEFT Alt + Enter
LEFT Alt+Enter
Looks like some languages override Right Alt behavior, at least in case of Lithuanian Left Alt is working fine with Lithuanian enabled, Right does not, when switch to English, everything is fine again. Was pulling hair to figure out why out of nowhere it stops working, thanks
In my case hint is showing Alt + Shift + Enter, but Ctrl+Shift+Enter works for some reason oO
In my case, I mapped Alt+Enter to a system shortcut (for expanding the current window) and I forgot. So it might not be another program, but your past self-sabotaging you.
I have the same issue. Alt+Insert not working while I was trying to generate getters/setters for my POJO class.
I just added another shortcut for that "Generate" operation.
If you are using Intellij Idea, you can do that by following steps:
Go to File -> Settings -> Keymap.
On the search bar appeared, search for "Generate", you will find an entry to which assigned shortcut will be Alt+Insert.
Right click on this entry and select 'Add Keyboard shorcut'.
Now, type your own shortcut that you want. In my case, I used Ctrl+Shift+G.
It worked fine and now I am using my new shortcut for Generate operation.
I had the same problem while upgrading to a new IDE version. The cause was a plugin error in new IDE version, I resolved disabling/updating that plugin.

Completing code block with semicolon in intellij java

I'm tired of having to take time to reformat code after every statement. Call me lazy or call me spoiled, but every IDE I've used reformatted code automatically when I entered a semicolon.
I've been using intellij because eclipse and android studio have too many internal dependencies that cause problems. But it doesn't reformat code the way the other two do. Is there a plugin or method I could use to correct this?
I didn't tried by myself but the following could address the problem with automatic re-format:
activate the option "save file automatically if the application is
idle for..." option in IntelliJ Idea Settings
install and configure the save actions plugin
https://plugins.jetbrains.com/plugin/7642-save-actions
Regarding Eclipse (I didn't use it for a long time) wasn't automatic reformat of the code triggered on file save? You said you had in eclipse this support on entering a semicolon.
Kind regards.
Also try shift-ctrl-enter. This completes the line, adding semi-colon, closing brackets etc but as a side effect also reformats the line.

Can't type in IntelliJ

I'm using IntelliJ IDEA on my Mac to work on a project, and I keep on coming across an issue where I can't type. Occasionally when I switch to another application and then switch back to IntelliJ I can't type anything, and the cursor doesn't appear on text when I click on things. Does anyone know what causes this? After 1-2 minutes it goes back to normal, but it's started happening more frequently and it's pretty frustrating to not be able to type and have no way to fix it.
This is the version of IntelliJ I'm using:
IntelliJ IDEA 2016.1.3
Build #IC-145.1617, built on June 3, 2016
JRE: 1.8.0_76-release-b198 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Turn off Vim Emulator from Tools in the IntelliJ, like this picture:
I am encountering this issue aswell, ...
MAC os Mojave 10.14.2, Inteliij Community 2018.3.5
Aside from restarting / clearing caches, I found that cmd + leftShift + F still opens the search window, and all my keystrokes appeared in the searchbox!
After the searchshortcut, I was able to close the searchbox and work again!
The answer here helped me https://intellij-support.jetbrains.com/hc/en-us/community/posts/206152119-Can-t-type-in-editor-window
Quoting the author of the answer:
I had the same problem. It goes away after I click the icon at top of
the scroll bar. it happens frequently on windows 7/10, and
occasionally on mac. my colleagues said they have experienced it too
Have the same issue occasionally, can't type in any Intellij windows. My temporary/quick fix, is to:
Close any terminal windows in intellij
Use cmd+shift+f to pull up the search window.
Seems to fix it, for a while.
Closed IDEA, all IDEA projects! Even though in other IDEA windows I could type.
Removed .idea folder in the project I could not edit.
Restarted IDEA.
Then I was able to type!
Maybe you entered Vim emulator as said. Maybe only by mistake :).
Control-V is a frequently used shortcut. And Control-Alt_V is the shortcut to enable Vim mode so you can see the problem...
How to know in five seconds: type a ":" (colon) and if the cursor jump to end of the screen, that is vim. If so enter q to quit and then Control-Alt-V (on windows) to go back to IDEA standard mode.
vi is a powerful text editor since ever. But only if you pretend and know how to use it... There is even a warning on the IDEA install saying like "do not install unless you are familiar with Vim" in yellow bold text, iirc.
[Follows historic data, that you may find boring off-topic or interesting]
Today's editors opens the code in edit mode right away so you can start typing over existing code. Vim by the other hand opens the code in, let us say, browsing mode: there is a set of navigation keys to browse the code. Everything you type is supposed to be a command. When you want to edit you enter INSERT mode and then you can type new text. Only then.
Just for more historic data: vi navigation mode is great for studying code you do not know, using IDEA, since it does not change the text unless you tell it to, and some vi commands are clever.
One example:
"/" (forward slash) is one search command, and "z" is a smart scroll command so that:
/setCellFactory will search for the next match of "setCellFactory" and put the cursor there
Then if you type "z" the code will be positioned so that line is the first on screen. And if you type "." the line will be at the middle. And if you type "-" that line will be at the last position at the screen. And you can use these commands again and again. And new slash will go for the next match, like F3
This "z" thing is a feature I miss in Visual Studio, IDEA, Eclipse, Word, WordPad: these commands to scroll text AROUND a pattern... /pattern, z, z., z-. The alternative is the mouse wheel...
I am used to vi since the 80's and is the editor I still use today on Linux terminals so when this happened to me on IDEA I was lucky to remember and suspect of that on the first time.
Sorry if these details are boring
Ensure you haven't unintentionally enabled vim emulation. Go to IntelliJ Idea -> Preferences and select Plugins. Scroll down and look for the vim emulation plugin and if it's checked, then either uncheck it or uninstall it completely.
Ran into same issue with intelliJ 2017.1.2, but no VIM Plugin. However, I had just created an empty project with some .groovy files. I could edit the files in the groovy project, but not java projects.
Only way I could fix java projects, was blow-away workspace.xml files in each, then I could edit again. However, had to re-create tomcat configs, breakpoints, other IDE settings. etc.
I had a problem with entering characters when working with .story files. When I tried to type in any character, it appeared for a short while and immediately disappeared. The cause of the problem was jbehave plugin I was using. After uninstalling it and restarting IntelliJ everything was fine.
It seems to be because another window has the cursor and is not giving it back.
Check any open floated windows, click on them & then click back to your intellij instance
alternatively, if you have multiple intellij instances open the cursor could be there...
Go to the most recently opened IntelliJ instance
Check if the cursor has become stuck in that project's terminal window, or another window
no? check all other open IntelliJ instances
For me it happened because of vim
Om Mac, I solved it by navigating to File → Reload All from Disk.
Keyboard shortcut: ⌥ ⌘ Y
IntelliJ IDEA 2020.1.4
Try disabling plugins one at a time. It was the "BashSupport Pro" plugin that caused it for me. Disabled it and I could type again right away.
I read other comments saying some other plugins caused the issue as well.