Auto import annotations in IntelliJ - intellij-idea

Is there a way to auto import annotations in IntelliJ?
When I place the cursor on #Entity annotation and press ALT+Enter. I don't find a option to add:
import javax.persistence.Entity;
Does any configuration need to be done to enable it?

Inside of your editor preferences (open using shortcuts ⌘, (macOS), or Ctrl+Alt+S (Windows/Linux)).
Go to Editor > General > Auto Import, be sure the correct values are checked. It should look similar to this:

Related

IntelliJ Idea intellisense does not show java.utils.List

From a moment on my IntelliJ Idea does not show java.utils.List class in Intellisense. This appens ONLY for java.utils.List all other classes are shown.
Is there a specific settings I inadvertently changed?
Navigate to Preferences/Settings | Editor | General | Auto Import and delete java.util.* pattern from the Exclude from auto-import and completion list.

How to close intellij auto sort imports?

IDEA version : 2019.3.1 x64
I know Settings | Code Style | Java | Imports,
but not found where close;
I don't like idea auto change original import order.
how to close IDEA self-assertion function.Thanks!
in Settings > General > Auto Import uncheck Optimize imports on the fly. Also while reformatting, you may disable it by unchecking Optimize Imports in Reformat Code Dialog.

IntelliJ Export Settings difference between Code Style and Code Style (schemes)?

I do want to make an export from my IntelliJ code style settings.
I've found the menu to do so how ever the pop-up that opens has lots and lots of checkboxes to tell IntelliJ what settings you do want to export.
Now I want to export all settings from the selected item (Code style) and its sub-items:
For this, which do I have to check (or both) in the pop-up to export the right settings?
Code Style
Code Style (schemes)
And what is the difference between those two?
I'm using IntelliJ version 2017.3
Last information: I don't know if this is necessary to know but we've already a settings export file in our project. We want to update it as we want to change some settings. What I now did was to import this file, update the settings we want to update and then export it. But as described above, I don't know which checkboxes I've to use for this last step.
Thanks in advance!
The solution #y.bedrov posted in the comments was right:
You need to select "Code Style (schemes)". This is the second option from the second image in my question. This brought the result I was looking for.
"Code style" (first option) exports information about the currently used scheme name.
I also found out that it doesn't really matter if you make any mistake on exporting the settings as you'll have the option to deselect any selected option on import.
I made an image as example. In this example I exported the two settings that are also checked in the question. On import you'll receive this window. Here you can select which one you really want to import.
Of course, when you have a specific thing to export it is better to only export the settings necessary to avoid that everyone has to deselect all unnecessary options on import over and over again.

How to format curly braces for autoformat in intellij

Whenever I hit alt-cmd-l to autoformat my code, it formats my imports and arrays from:
import { CommonModule } from '#angular/common';
let arr = [ myStringVar ]; // simple example, just go with it
to
import {CommonModule} from '#angular/common';
let arr = [myStringVar];
How do I tell IntelliJ to put a space after the opening brace and before the close brace when auto-formatting? (Specifically for javascript, typescript)
I've looked around for the answer and could not find one or asked the question badly. So I apologize if this is duplicate.
I'm on Intellij 2016.3.3
Go to preference, select Editor > Code Style > Javascript and choose Spaces, check the checkboxes in Within section "ES6 import/export brances", and if you want spaces in object literal braces, check "Object literal braces" and as well.
Go to settings and search for ES6 import/export braces. It should take you to Editor -> Code Style -> Javascript (or TypeScript). Just hit that checkbox on the spaces tab and it should add the spaces back.
As you are using Angular, I believe you need to edit the settings for the Typescript and NOT for JavaScript. As I am using IntelliJ IDEA 2021, I will give you the fix for the same. You can do so by going through the following path:
Go to File > Settings... > Editor > Code Style > Typescript
Click on the Spaces tab.
In the Within collapsible, tick the checkbox that says "ES6 import/export braces".
Click on Apply button and then click on Ok button.
If you now go to the Typescript file and hit the combo: Ctrl + Alt + L, it should now format the file correctly.
CAVEAT:
You have to be careful to ensure that you are making the changes for the Scheme that is applicable for your project. For example, maybe you have customized your Editor in some way previously and saved your customizations under a new name, such as MyCustomSettings. Once you do this, you will notice that there is an additional Scheme called the Default scheme. But MyCustomSettings will be your Scheme for your project and you have to make sure that you make the changes for the MyCustomSettings Scheme and not for the Default scheme. You can refer to the Schemes via the following path:
File > Settings... > Editor > Code Style > Typescript, there is a dropdown referred as Scheme. Choose the appropriate one for your Project and make sure you make the above edits in that Scheme.

How to IMPORT keyboard shortcuts in Adobe Dreamweaver

I recently upgraded to Adobe Dreamweaver CS6. I have backup my CS5 keyboard shortcuts into a "dreamweaver shortcut.htm" file from the Edit Menu > Keyboard Shortcuts option but I am just not able to find an import option in cs6 or any of the old dreamweaver versions as well to import my old shortcuts into the new version.
If anybody knows the import method for keyboard shortcut in Dreamweaver please let me know.
Thanks in advance !!
This worked for me in Win7:
(Replace [your_profile] with the name you use to log in to this machine. If you're not using the English-language version, you'll need to change en_US to your local variant too.)
Go to:
C:\Users[your_profile]\AppData\Roaming\Adobe\Dreamweaver
CS5\en_US\Configuration\Menus\Custom Sets
You should find two files there:
active set.txt (which just contains the name of the keyboard shortcut set you were using)
and the xml file containing your lovingly crafted shortcuts.
Copy the xml file (or both of them, if you wish, in which case CS6 will start with this set) to:
C:\Users[your_profile]\AppData\Roaming\Adobe\Dreamweaver
CS6\en_US\Configuration\Menus\Custom Sets
Seems like Adobe doesn't provide an option to import the exported keyboard shortcuts back.
I got the following lines from one of Adobe resource for creative cloud from which I assume that there isn't any inbuilt command provided by Dreamweaver to import the shortcuts back but to manually do it.
Export keyboard shortcuts
Before upgrading to Creative Cloud, do the following:
1. Select Edit > Keyboard Shortcuts
2. Click "Export Set As HTML" button.
After you upgrade, refer to the exported file to set the shortcuts again.
Reference - http://helpx.adobe.com/pdf/dreamweaver_reference.pdf