0

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.

enter image description here

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

enter image description here

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.

DSlomer64
  • 4,234
  • 4
  • 53
  • 88

1 Answers1

1

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.

enter image description here

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:

enter image description here

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:

enter image description here

Dmitry.M
  • 2,833
  • 1
  • 17
  • 30