Intellij IDEA inline documentation doesn't highlight {#code } blocks as monospace - intellij-idea

I use IDEA 2016.3 (but the problem existed in previous versions too):
When I call inline documentation (Ctrl+J on Mac, Ctrl+Q on Win) for Java methods it opens Documentation for window, and it is pretty good formatted according to JavaDoc guides, except {#code XXX} blocks have the same style as normal text. See the attached example for java.util.HashMap#get method and compare it with the reference from Oracle site:
The root of the problem, probably, that the documentation is already monospaced. So, maybe there is a way to highlight the code blocks with a background? Or to make the default documentation text in non-monospaced font?
UPDATE:
the same issue on Windows with Segoe UI default font (non-monospace):

As far as I know the quick documentation window does not have a monospaced font by default in IntelliJ IDEA. To revert the documentation back to a proportional font:
Invoke Find Action... Ctrl/CmdShiftA and type Registry Enter. Disable the documentation.component.editor.font option in the Registry dialog that appears. Be careful with the other configuration options, because it is possible to break your IntelliJ IDEA installation with an incorrect setting.

Related

Tooltip doesn't let me type text when it is appeared. IDEA's editor

I am working with Itellij IDEA (2017.2.4). I am not sure whether the reason is new version of IDEA, but I started to face it after new version installed.
When I type some code in editor and Tooltip is shown (it can be inspection or just parameters of method shown ect.) I cannot type new symbols until pressing ESCAPE button, it is not useful for me. Before updating the IDEA there was behavior when user types new code, tooltip is hidden without ESCAPE pressing. It was made hidden by any key pressed.
Actually maybe I just change some setting property unconsciously, if yes - what is the property needed to be restored to default?
How to make it hidden not by ESCAPE but by any button?
In next image I pictured the moment when only ESCAPE key can be pressed.
I'm not able to reproduce the issue, even when I use v2017.2.4 on windows. The behavior should be that you can still type even when the tooltip is present:
I can't think of anything in terms of settings that could cause this issue. If it's just the "parameter info" tooltip that is causing the issue, you can disable it (or just increase the delay time) from automatically popping up via the setting: Settings > Editor > Code Completion > "Parameter Info" > "Autopopup" You can then manually open it via the Parameter Info Action via Ctrl+P / ⌘P. The setting #Maciej-Białorucki mentioned will effect the time before other tooltips open. Setting to a high value might help if other tooltips are causing issues.
Personally, I find the auto popup useful. To troubleshoot why this is causing issues, I'd recommend trying the following:
Upgrade to v 2017.2.6 which was released yesterday. While I personally can't reproduce it, and I'm not seeing anything about it in the 2017.2.5 Release Notes nor the 2017.2.6 Release Notes, it can't hurt to try and upgrade.
Disable all third party plugins and restart IDEA. See if the issue persists. In my 14 years of using IDEA and helping people with it on the forums, I've seen 3rd party plugins having bugs that cause other parts of IDEA to misbehave. Since you recently upgraded, it's possible a 3rd party plugin is having a compatibility issue with the new version. If the disabling them solves it, use a binary search to as you re-enable the plugins to track down the culprit and then report the bug to the plugin's developer.
See if it happens in other projects. If not there may be something wrong with the project's configuration. (A long shot. But worth checking out)
As another long shot, you can try invalidating the caches and then restarting IDEA via File > Invalidate Caches / Restart... I have on occasion over the years seen a corrupted index file or cache cause strange behavior.
If none of the above work, I suggest opening a bug report with JetBrains at: https://youtrack.jetbrains.com
Check Tooltip initial delay(ms) option under Appearance in Idea settings.
As I divined there was a property in settings that influences to the behavior described in a question. So to continue writing code without pressing ESCAPE key you must uncheck the following property:
Menu page Settings -> Appearance & Behavior -> System Settings
Checkbox Accessibility -> Support screen readers (requires start)
(for more details see the link)

How to make auto completion in WebStorm (*.js) and IntelliJ (*.go) work the same

In WebStorm I can type something like
document.gEBI
press tab key, and it'll autocomplete to
document.getElementById()
But when I do the similar thing in IntelliJ
fmt.Prl
Auto completion doesn't work (the desired result fmt.Println()) at all, it works only if all the letters match strictly in order.
Is it possible to enable this functionality in IntelliJ? I've imported all the settings from WebStorm.
These Tab key shortcuts aren't part of the auto-complete system the Jetbrains use for all their IDEs as LazyOne says, they are actually part of the template-invocation system.
The auto-complete functionality is built into the shortcut: Ctrl+Space.
I suggest looking up the template invocation for .Println() in the settings, Jetbrains documentation, or raising a ticket with Jetbrains on YouTrack for clearer documenation/control over template-invocation.

Intellij ignores the selected keyboard layout

This seems like a bug in IntelliJ 12: Every couple of times when I switch between keyboard layouts (English and Hebrew) IntelliJ get stuck on one of them and ignore the windows selected keyboard layout. This happens only for intelliJ, all other programs respond as usual to the windows selected keyboard layout.
Is there at least a workaround, or a way to reset IntelliJ's keyboard layout? The only thing that seems to work for me so far is restarting my machine...
(My OS is Windows 7 Enterprise 64bit)
This is 100% reproduced when you switch keyboard layout in quick class search (Ctrl+N). Also in intellij idea 13.
Something like:
Open quick search menu when keyboard is not in English layout (Russian e.g.)
Type anything
Switch to English
Congratulations! you stuck in russian layout :) restart your intellij idea!
When I ceased to switch layout in search, I forgot about this problem.
UPD: it's suitable for most part of text inputs (even for search and file creation)
I've just had this problem on PyCharm 2020.2.3
Here's how I've solved it:
Go to Settings -> Keymap
At the bottom of the window, check the option Use national layouts for shortcuts (require restart)
That did the trick
restarting IntelliJ also works.
I wonder how they managed to get such a stupid bug, this is not an easy bug to write, especially in Java.
That was found to be more like a global Microsoft/Oracle bug. Simple workaround from IntelliJ's issue tracker: use Windows' language parameters to assign a hotkey (Ctrl + number) for changing the layout directly to a desired language. This suddenly will affect both Windows And IDEA. It's said that bug was fixed in Win8. A bit more info: here
In 2020 bug is still relevant in the most IDEs based on IntelliJ. For example I observe this in PyCharm now.
There is workaround for Windows:
Go to Language Bar - Settings... - Advanced Key Settings
Set key sequence of To English action to Ctrl + 1
Set key sequence of to other your language to Ctrl + 2
Apply
Go to IntelliJ/PyCharm and switch language by new sequences
After that bug disappears and you can switch language by traditional method
For me the following actions seem to resolve the issue:
Go to Control Panel
Select Clock, Language & Region
Press Region
In the opened window choose English for Format.
Also all my settings except the location are set to English (locale, default keyboard etc.)
This fix worked on my mac, access Preferences -> Editor -> Typing Corrector from the intellij IDEA menu. If you are able to navigate to the same window on your OS, you can try this.
Uncheck Enable keyboard layout correction in the Typing Corrector window
I got the same issue in Ubuntu 16.04. Restarting IDEA doesn't change anything. But Changing the default layout to be the one I want by default ensured ubuntu work well with it.
Go to the search textfield above file editor.
Switch layout.
Type smth.
Click somwhere in the file editor.
Write smth with swithed layout.

How can I change the font in a CommandShell window in pharo or squeak?

In Pharo and Squeak, if it's installed you can type CommandShell open. and it will open a command window which is basically like a "bash shell" or "terminal window", but it is using a nearly microscopic sized default font. I can't seem to figure out how to change it.
I figured out that the general approach in smalltalk is to browse the implementation of a class and see if you can find out something you could say to the class to tell it what you want, or some way you could modify the class so it answers something different to some other class, causing the desired effect. Something like anInstanceOfCommandShell someViewOrControllerThingy setDefaultFont:blahblahblah or something like that.
It seems a CommandShell uses a ShellWindowMorph and that it accepts a setFont message. I'm rather new in Smalltalk and Squeak, and have no idea what to do next.
I'm using Pharo 2.0 but if someone knows how to do it in Squeak I'm sure it would be about the same.
Note that I've found the settings of pharo and that the regular settings changes affect the main transcript window, but do not affect the special CommandShellTranscript or its contents in any way.
The code I use to change the rest of the fonts programmatically was this answer from another question. which says to do this:
|font codeFont|
font := LogicalFont familyName: 'Consolas' pointSize: 10.
codeFont := LogicalFont familyName: 'Consolas' pointSize: 9.
StandardFonts listFont: codeFont.
...
You may override the ShellWindowMorph default #textStyle by the following one:
textStyle
" Answer a font for the text morph"
^ TextStyle default
The window should have a way to set the font directly from the shell menu (the top right arrow) or from the Settings Browser. You may modify any morph property by bringing the "Halo" menu over the morph you are interested (Alt+Shift+Left Click under MS Windows) and select the red icon. Then select Debug -> Explore morph and set the text style directly from the Explorer:
self textMorph setTextStyle: TextStyle default
ShellWindowMorph uses the system-wide DefaultFixedTextStyle.
In Squeak, you could change it like this:
TextConstants
at: #DefaultFixedTextStyle
put: (TextStyle fontArray: {StrikeFont fromUser}).

Disable IntelliJ Warnings

It really annoys me that IntelliJ highlights certain 'errors' (that don't prevent successful compilation) the same way that real errors are highlighted. For example, a magic number is not really an error, but it will be flagged in exactly the same way as an incompatible type error.
How can I change this?
Go to Settings -> Inspections. Then you need to search through the long list for the offending inspection, which you can get the name of by hovering on the warning marker in the margin. You can change the severity of the inspection, whether it's an error, warning, etc. or just disable it altogether.
Edit: if you search for "magic" in Settings, you get the following, which should be helpful:
Whenever you see an inspection warning/error you can place the caret on it and press Alt+Enter (a light bulb also appears that tells you that). A menu will appear with suggested quick fixes. You may need to open a submenu by pressing Right, and you'll find "Edit inspection settings" there. Having invoked that, you may proceed as in hvgotcodes's answer :), it's just a faster way of getting to those settings.
As Michael Calvin said you can use the SuppressWarnings annotation. For example:
#SuppressWarnings("OptionalUsedAsFieldOrParameterType")
See https://github.com/JetBrains/intellij-community/blob/master/plugins/InspectionGadgets/src/inspectionDescriptions/OptionalUsedAsFieldOrParameterType.html
Usually searching the internet for the exact description leads me to this.
Not directly relevant to the OP, but may be of use to future Googlers
I got to this question while trying to figure out how to disable IntelliJ IDEA's warnings about Guava functionalities that have been replaced by Java 8 features. I'm not able to use the Java 8 versions of these features in my case because of a library we're using that was built with Guava (despite being a Java 8 project). So to solve that, I added a SuppressWarnings annotation before any class using Guava:
#SuppressWarnings(Guava)
public final class...