I used to see the line and column (character count) in the status bar of Eclipse (actually Precision32's version of Eclipse), but somehow it went away. According to the Eclipse UI guidelines it's supposed to be there:
Editors with source lines of text should show the current line and
optionally column numbers the status line. It's optional for the
editor to show line numbers for each line in the editor itself.
But I can't find anything that tells how to turn it on. I didn't update my editor, AFAIK.
Edit:
The editor is active.
I have no idea what happened, but it started working again. Might be when I installed Juno eclipse, maybe some register settings in common were touched? I hate doing a re-install to fix a problem as you lose settings and it isn't getting to the root cause, but for this round I'll have to accept it.
Related
My VSC shows the wavy underlines when something's wrong with my code, but does not display the hint overlay when I hover my mouse on it.
This happens whatever the language used (from CSS to Typescript) and whatever the type of irregularity (e.g. notice, warn, danger)
I'd say that's a setting I may have changed at some point, but can't find which one. Any idea?
More details:
I do have the message displayed in the Problems tab besides to the Terminal, but it forces me to switch from tab to tab ;
I do have other overlays like autocomplete/autosuggest ;
No extensions in my setup could have led to that situation (only a few installed, widely downloaded, nothing fancy or dodgy).
Actual behavior (nothing happens):
Expected behavior (from google images)
Go to File > Preferences > Settings.
Search for 'hover.enabled' (See below photo).
Toggle it.
If your editor still does not pick up the change, close all tabs, close all VSCode windows, and reopen it.
If it's still not working, try uninstalling VSCode and reinstalling it (make sure you don't have setting sync on).
Also, this question has been answered in at least one other place (Disable tooltip hint in Visual Studio Code)
EDITED (see bottom)
Is there really, after so many years of unanswered questions such as mine, no keyboard shortcut to jump to the next or the previous error in Netbears 8.2?
This page says that the shortcuts are
Ctrl+./, Next/previous usage/compile error
Note the inclusion of the word usage. In no other "Next/Previous" shortcut is usage used. I wonder why it's here and if it points to the problem. It's not exactly a typo. What might it mean? Yeah, probably nothing.
Whatever, absolutely nothing that I have found shows how to accomplish this very important pair of tasks.
Using Tools > Options > Keymap shows that Ctrl+PERIOD and Ctrl+COMMA are how to do it. But it doesn't work.
Once Ctrl+PERIOD took me SOMEwhere, and doing it again took me to the next occurrence of it, etc., but those lines of code had no errors and it doesn't happen now.
I've clicked on the ellipsis on the line for Next Error and Previous Error and edited them to be Ctrl+BACKQUOTE and Alt+BACKQUOTE and I clicked on the ellipsis and defined alternative shortcuts to be Ctrl+CLOSE_BRACKET and Alt+CLOSE_BRACKET and I could NOT define Next error in Editor to ANYTHING.
NOTHING works.
So my question is WHY NOT? I use F2 and shift+F2 in Android Studio with every error I get! How can this NOT be possible in Netbeans 8.2?
I am reluctant to upgrade to Netbeans 11 for just this, especially not knowing if this problem persists.
======================
EDIT
After looking at what #Dmitry_M submitted, I took another whack at it with the above definitions, which cause:
Alt+1 to take me to Next Error, but ONLY after a fresh Build or Clean and Build Project, and it takes me to other lines (in xml, for one) that have no errors (that I know of; they're not flagged).
Alt+2 to take me to Previous Error unless I fixed it, in which case it takes me to that same line that HAD the previous error, just as Alt+1takes me to where the next errors USED to be and to the other places, too.
Next Error in Editor to do nothing.
This makes me wonder what Category actually means since Next Error in Editor says Source while the others that DO work say System.
My source files have more than a few "yellow warning" indicators, but unike Dmitry, the definitions don't find them.
If it finds the errors among other things, that's better than it was. But it only finds errors already listed in Output, and it requires build, and it finds other extraneous "errors". So I'll just look at Output. Keymap fails.
I'm discouraged with Netbeans 8.2.
I am using NetBeans 8.1
Next Error in Editor
The keymap moves a cursor to any hint or error that the editor shows. They are sometimes not compiler's errors. See it in action.
For example, the cursor moves to int i = 0; but there is no error there. There is just a hint that variable i is not used anywhere. And in the import statement: it's just a hint.
If you want to define a keymap for Next Error in Editor action try different key combinations. I use alt+1.
Previous Error/Next Error
The keymap only works for clean and build or build actions.
Probably, when just editing and saving NetBeans doesn't refresh errors list somewhere in the cache. It explains the behavior you experience: the cursor moves to a line where there are no errors. It simply moves to the line where an error was during the last build or clean and build action.
Se it in action just after clean and build. It works:
The cursor indeed moves only between "real" compilers' errors. But it only works after clean and build or build action. Probably it's a bug. There is a relevant bug but it was not resolved.
Also, in my case, Ctrl+PERIOD and Ctrl+COMMA were not working completely. Changed my keymaps to this one:
When I am checking the naming rules for my code. If i got variable or function name have more letters than allowed ERROR. I count the total character by manually or have to copy paste into Notpad++. Is there is any options to find the number of selected characters in eclipse.
Eclipse does not provide a way to display the length of a text selection like NotePad++.
Bug 73904: Show length of selection in status box was raised in 2004 (!!!) to add this feature but it still hasn't been implemented.
The good news is that someone has written a plugin named getStringLength to do exactly what you want, as mentioned in a comment in the Eclipse Bug Report:
Eclipse plugin that add the selected text counter on the right side of
the column and row position in the Eclipse status bar. After you
double click the text, this plug-in will show the length of text you
selected in the eclipse status bar; in the case you select more than
one row it will show the number of rows selected, like Notepad++ do.
The bad news is that I couldn't get it to work properly. After adding the plugin to Eclipse's dropins folder the status bar is updated as described, but the details are misaligned and not rendering correctly:
Through careful testing I can see that the plugin actually is updating the length of the selected text, but the entry on the status bar is practically illegible. Still, in the absence of anything else, it is worth trying - perhaps you will have better luck in your environment. Let us know if it works for you.
You don't need a plugin anymore with Eclipse 2019-09:
Editor status line shows more selection details
The status line for Text Editors now shows the cursor position, and when the editor has something selected, shows the number of characters in the selection as well.
This also works in the block selection mode.
These two new additions to the status line can be disabled via the General > Editors > Text Editors preference page.
i has fixed error rendering in eclipse version=4.12.0 on windows 10, with steps.
clone project (getStringLength project)
import to
edit file com.lyf.plugin.getStringLength.SelectedTextInfoControlContribution.java (line 26).
#Override
protected Control createControl(Composite parent) {
parent.getParent().setRedraw(true);
......
}
build plugin:
1. Right-click your plugin project in Package Explorer window.
2. Press Export... in shown context menu.
3. Select Plug-In Development -> Deployable plug-ins and fragments (or Deployable plug-ins and fragments directly in old Eclipses).
4. Close Eclipse. Copy this JAR to eclipse/plugins/ path. Run Eclipse again.
Good luck!
I've followed all the suggestions here.
When I press return, I get a new line that is indented with tabs instead of spaces.
If I backspace to clear the tabs, and then press TAB a series of times, it correctly indents with spaces.
I'm pretty sure I have all my settings set up correctly. I created a new Code Style > Formatter policy for every language in the project, and specified to always use spaces. It seems as though these settings are partially active (ex: when I press tab), but inactive when I use return. I tried restarting Eclipse. I'll try restarting the computer now...
I'm using Mac OS X 10.9.2 and a Liferay Developer Studio (1.6.3.v201312111844) version of Eclipse (not sure which Eclipse build its based on though).
Can anyone think of another setting/solution to ensure that newlines are created with spaces instead of tabs? I recently saw http://editorconfig.org/, and I'm wondering if there's some interference.
Thanks for any suggestions
If the file has existing lines that are using tabs, then Enter will respect that and try to create new lines in a similar way (see this comment by topchef for a solution). Also, it could be something in Liferay Studio's proprietary settings is overriding Eclipse standard preferences (as suggested by user John).
Keep in mind that each type of editor in Eclipse can have its own preferences and perhaps that's what you're running into here. You can try to find them all by opening Preferences and searching for "indent" in the search field. That will show all the preferences pages where indentation can be configured.
Also note that the Formatter settings don't have any affect on as-you-type formatting; that's for when you select a file or group of files or part of a file and choose Source > Format from the menu.
I've seem to have lost the ability in my Eclipse to auto-correct errors in my source code lines.
For example, a line like this:
Date date = new Date();
has red jagged lines beneath the Date() part. Previously I could mouse hover over it see a popup menu of options to fix it. Now I all I ever get is a popup with the text "Cannot resolve to a type".
The only change I can think of that I've made and I don't know if it has anything to do with this problem, is that I started editing my .java files with an outside editor. Then focusing back into Eclipse I get a popup saying the source has changed and do I want to update so I say OK.
Sometimes I will edit inside Eclipse and sometimes i will edit the source outside of Eclipse. I'm not sure if this is a bad practice or not?
Its your wish to edit Java files outside or inside eclipse. But Java editor has many features which are very helpful to developers. I suggest to edit Java files inside eclipse only.If you find other editors are good or you used to it then no problem you can edit Java files out side eclipse also. The problem you mentioned in not related to it. But make sure that changes are applied before building project in eclipse.
Solution
This occurs whenever there are multiple classes are available with the same name in you build path then eclipse don't know which one to import by default. So keep the caret on the error line and press Ctrl+1. Then a eclipse gives options to user to import one among these. See the picture below. Choose the right one then error will disappear.