• Mark Occurrences functionality provides for user an option to see usages of the identifier under cursor being highlighted in the current file.
  • This functionality is already provided by NetBeans for Java and C/C++ behavior should be the same

Use Cases

  • When user navigates over the document after each change of cursor position the identifier under cursor (or cursor is exactly before cursor or after it) is highlighted
  • All occurrences of this identifier in the document are highlighted too.
  • If user moves cursor identifiers are kept highlighted until new identifier would be pointed out by cursor (optional)


  • highlighting
  • default color is ECEBA3
  • can be customized in Tools -> Options ->Fonts and Colors -> C/C++ -> Mark Occurrences
  • options (Tools -> Options -> C/C++ -> Semantic Highlighting)
  • Enable Mark Occurrences
  • Keep Marks (if enabled: highlighting is not cleared on cursor moves until new set of identifiers would be pointed out by cursor)
  • annotations
  • for each marked occurrence it should be marked by glyph at rightside bar
  • each glyph is clickable and scrolls document to correspondent position by click

Optional interface parts (todo)

  • shortcuts for fast navigation between occurrences (it means scrolling edited file, not moving a cursor)
  • forward "Next Occurrence"
  • backward "Previous Occurrence"
  • shortcuts do nothing if there is no marked identifiers
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo