unable to set breakpoint in intellij - intellij-idea

I am trying to set breakpoints, nothing happens for couple of classes that I compiled recently with "mvn install". I am able to set breakpoints to classes which were already built by someone else.
Please let me know if anyone knows how to solve it.

Had the same issue while using IDEA CE 15:
Removing the Python CE plugin 5.0.143.103 fixed the issue... but no Python parsing! :(

File -> Invalidate Caches and Restart helped solve the problem. Thanks Tomasz Nurkiewicz for the directions

In my case, the issue was caused by PHP Plugin (https://plugins.jetbrains.com/plugin/?id=6610). Even after "Invalidate Caches and Restart", the issue persisted.
Uninstalling that PHP plugin, solved my problem.

By nothing happens do you mean that breakpoint isn't hit? Take a closer look at breakpoint icon. Especially see the difference between
and
icons. The latter indicates the code you run while debugging doesn't have any meaningful instruction on that line.
One of the reasons for such behaviour is when code you run is not the code you see. It can happen when application server can is still running old JAR or something similar. This seems to be the case since you say that breakpoints work in older code.

The solution to fixing breakpoints was adding the wildcard file extension "*.py" to the Python File Types in Python (it must have the wildcard symbol prefix, not just ".py") through taking these steps:
Go to:
IntelliJ IDE > Preferences (CMD+,) > Editor > File Types > Recognized
File Types
Under "Recognized File Types" heading:
Scroll down; Select "Python"
(associated Registered Patterns will be shown below)
Under "Registered Patterns" heading:
Click "+" icon; Enter "*.py", Click OK
(do whatever is necessary to achieve this, including removing/renaming others without the wildcard if necessary)
Add breakpoints by:
Select line(s) of code (not an empty line or comment); Going to: Run >
Toggle Line Breakpoint (CMD+F8)
Configure debugging with breakpoints by going to:
Run > Edit Configurations...; Click "+"; Select "Python"; Add a value
for the "Name" property; Select location of the ".py" file to debug
(in the "Script" property); Click OK
Debug using the breakpoints by going to:
Run > Debug... (Fn+CMD+F9); Wait until it stops at a breakpoint;
Inspect variable values shown in the file itself by hovering over
variable; Click variables and view the Frame and Variable details in
the Debug window by going to: View > Tool Windows > Debug (CMD+5)
Important Note: Initially I tried doing the following but after each one I was still unable to use breakpoints afterward:
Removing and reinstalling the Python plugin:
Entering CMD+,; In the dialog window going to Plugins > Install
Jetbrains Plugin.. > "Python" > Install
Updating IntelliJ Ultimate edition to the latest version v2016.3.4
Going to:
File > Invalidate Caches and Restart

Right click on the gutter (where you normally click to set breakpoint)
select "Configure Gutter Icons..." then enable the checkbox at the top that says
"Show gutter icons"
That fixed it for me

Simply closing and reopening file worked in setting gutter breakpoints

This is embarrassing but posting here in case this solution will help somebody else: A breakpoint will not show up if you attempt to place it between executable lines of code. The breakpoint must be located on an executable line of code to work. Make sure you click on the gutter next to an executable line or place your cursor on an executable line when you use the shortcut. Once I did this, the breakpoints worked.
"Click the gutter at the executable line of code where you want to set the breakpoint." https://www.jetbrains.com/help/idea/using-breakpoints.html#set-breakpoints

Related

WebStorm stop popping up output Run window in LiveEdit mode

I am developing using WebStorm and its plugin LiveEdit.
So as I start changing some SCSS code, it starts to recompile all files and outputs an error, because I am still typing.
But the most irritating thing is that Run output is popping up each time it compiles with an error and this makes my IDE to jump up and down, sometimes overlaying line of code is being edited.
So my question is it possible to disable autopopup of Run output ? Or maybe any other ways to hide this window. I can set longer delay, but this still won't solve the problem.
Reposting #LazyOne comment on the question as a working answer:
Go to Preference > Tools > File Watchers
Select your watcher (most likely it will be Babel)
Click on the Edit (pencil) icon in the bottom
In the File Watcher window click on Show Console and set it to Never: Example - link
Click Ok and save

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.

Refactor rename broken in Intellij IDEA

Somehow, I managed to break my refactoring capabilities in Intellij IDEA 12. I have somehow disabled it for my project. Renaming a member through Shift+F6 doesn't work. The inline edit box is not drawn, nothing happens.
I know of the refactoring settings in Settings -> Editor, Enable in-place mode and Preselect old name are both checked.
It has to be some kind of project setting. I checked by creating a test project, adding some member and renaming it, which works perfectly.
What setting am I looking for? Or could my project be broken?
There is no way to turn refactoring off in the settings. My guess is that the project's cache/indexes are corrupted. I had a case once where refactoring, especially renames, stopped working. A re-index solved it for me. Go to File >Invalidate Caches, invalidate your caches, restart IDEA, and let IDEA re-index the project (progress is shown in the bottom status bar right of center). Then try the refactoring.
If that does not solve it, take a look in the logs (Help > Show Log) and see if there is any indication in there as to the cause of the issue.
Fo all the MacOS users, do not forget to access Settings -> Keyboard and turn on the flag for the option Use all F1, F2, etc. keys as standard function keys. E.g.:
Otherwise IntelliJ will not get the focus to use the F4 key.
Following step worked for me:
From your IDE, go to: Preferences -> Project Structure -> Add Content Root, then select the folder you want to use.
None of the above steps worked for me in IDEA 2021.2.4 (Ultimate Edition). I got the following error message when trying to rename a file and its usages:
Cannot perform refactoring. Selected file is not located inside the project.
Instead, I had to create a new module.
File > Project Structure > Modules > Add (+) > Import module > Select <root_folder_of_your_project>
This reindexed the whole project, which took a couple of minutes, and restored the Refactor > Rename functionality.
waite for some time it can be due to running Indexing

Missing "messages" window after compilation in IntelliJ

I'm using IntelliJ IDEA 12. When I run "make project", "debug" or "run" task it does some compiling, shows little bubble that there are warnings, shows grayed-out tool window "message" and after few seconds it hides the nameplate of messages window.
Why is compile log missing? What to do to fix this? I'd like to see (in IDE) what causes those warnings...
PS: I'm not sure, but it might started doing this when I started using Scala (it's now a mixed Scala-Java project).
If you've previously selected "Hide Warnings" then the Messages window is unavailable if there are no compilation errors. It is not even possible to show the empty window using View->Tool Windows-> Message or Alt-0.
Solution:
introduce a compilation error
build, the Messages window should reappear to show your error (or at least be accessible via the View menu)
go to the Messages window and deselect Hide Warnings
fix the compilation error
Rebuild Project and all your warnings will be visible
(I had the same symptoms on 13.0.2 and this worked for me)
For me, it pops up on "Rebuild Project". Maybe that helps.
The window should be there any time IDEA compiles the code. (If there is a not a code change, and you rerun something there is no compiling done and the message window will not show). It is accessible (by default) via Alt+0 (Zero, not the letter 'Oh') or via View > Tools Windows > Messages
You may have a combination of some tool window settings causing this.
If all the tool window buttons are hidden, the messages tool window will be as well. You can toggle this setting via View > Tool Button or the icon in the very bottom left corner of the IDE. To temporarily show the buttons when hidden, hit the Alt twice, holding it down on the second hit.
If the messages tool window is not set to "Docked Mode" and "Pinned Mode" it will close after the compile.
If the above is not the issue, make sure you are using the latest version of IntelliJ IDEA, v12.1.6, and the latest version of the scala plug-in, v0.22.302 (Go to Settings > [IDE Settings] > Plugins and look for the scala plug-in). Those versions work as expected for me.
Looks like u do not have any errors and warnings! In this case in Idea "Messages" tool window auto disappears. I hade the same issue and passes half an hour to understand the reason!

IntelliJ - show where errors are

Is there a way to make IntelliJ mark error locations continuously for the files you are working on in the similar manner as Eclipse does? At the moment I need to make the project which lists all the errors in the message panel, but even then I cannot navigate to them using the editor panel. I would like to have simple dots/markers which would point to error/warning locations.
IntelliJ IDEA detects errors and warnings in the current file on the fly (unless Power Save Mode is activated in the File menu).
Errors in other files and in the project view will be shown after Build | Make and listed in the Messages tool window.
For Bazel users: Project errors will show on Bazel Problems tool window after running Compile Project (Ctrl/Cmd+F9)
To navigate between errors use Navigate | Next Highlighted Error (F2) / Previous Highlighted Error (Shift+F2).
Error Stripe Mark color can be changed here:
For those who even yet have the problem, try enabling "Build project automatically" in the Java compiler settings and see if that makes a difference as it worked for me.
I ran into the problem of not having set my sources root folder (project window--right click folder, mark directory as > sources root). If you don't set this IDEA doesn't parse the file.
For IntelliJ 2017:
Use "Problem" tool window to see all errors.
This window appears in bottom/side tabs when you enable "automatic" build/make as mentioned by #pavan above (https://stackoverflow.com/a/45556424/828062).
To access this Problems panel, you must set your project to build automatically. Check the box for Preferences/Settings > Build, Execution, Deployment > Compiler > Build project automatically.
Frankly the errors are really hard to see, especially if only one character is "underwaved" in a sea of Java code. I used the instructions above to make the background an orangey-red color and things are much more obvious.
In IntelliJ Idea 2019 you can find scope "Problems" under the "Project" view. Default scope is "Project".
Besides, you can choose going to next error only (ignore warning) by:
Right click the Validation Side Bar.
On the context menu, choose the Go to high priority problems only
it works for Intellij Idea 12
In my case, I unknowingly unchecked 'Error Stripe Mark' option (Idea 2018.2: Settings > Editor > Color Scheme > General and expand `Error and Warnings' & click 'Error').
Fix is to check 'Error Stripe Mark' option of 'Error' (as highlighted in the below image). Now you will see the error marks in scrollbar area.
In my case, IntelliJ was simply in power safe mode
Do you have a yellow icon like this [_] at the bottom of the main window?
It is a "type-aware highlighting" switch which could be disabled accidentally.
You should re-enable it by clicking on the icon.
In the intellij hit ctrl+alt+shift+s and go to global libraries and click on plus icon to add the java libraries this will solve your problem. now you will see the errors coming up
enter image description here
This is the solution I found:
Open IntelliJ Setting (Crtl + Shift + A);
Click in "Editor";
Click in "Color Scheme" + the Programming Language (inside "Color Scheme");
Select "Analysis Error";
Select "Error stripe mark" + Add the Color desired