Find class containing word

Is it possible to jump to the point in the file where the class header is written?
I have a very big C++ code. Say I look for a word in all the project files and the results come up in the project find results tab. I click on the one I’m interested in and it takes me to the file. So far so good.
But then I have to scroll way up and keep my eyes peeled on the screen to find where in said file is the header/declaration of the class or function which contains the word that I searched for. And I won’t know the name of the class so I can’t just search for it to begin with.
Is there a way around this?

Thanks :slight_smile:

Perhaps the TODO package can be used to locate //TODO (or other custom keywords embedded in C++ code).

Are you looking for something that can provide an outline map?
(?: https://github.com/atom/symbols-view … built-in)
(?: https://atom.io/packages/structure-view)
(?: https://atom.io/packages/ctags-status)

Or are you looking for a hyper-click experience?

1 Like

Thank you snoop, the symbols view did help.
A hyperclick experience or keyboard shortcut would be much more useful.
I’m sorry if my initial explaination wasn’t clear enough. Basically I need something which can do the following:
Say if I am somewhere in the middle of a code which is written as:

Function name [output]:(input)
+

  • 1000’s lines of code

This is where I am
+

  • 1000’s lines of code

Function end.

How can I get to Function name [output]:(input) without having to scroll up? And assume I don’t know what the name of the Function is.
The symbols view is helpful in that it gives the line number of the symbols, so I can look for the first symbol with a line number smaller than the line I’m currently on. But it still can be a bit time consuming to do that.

Thanks

Hello.

Not working with C++ puts me at a handicap. The main grammar I use does not have parsers as what are available for C++. To make Atom useful to me I had to develop a grammar for it. I describe what I do, which may help you think of options.

My keymap file has these lines:

'atom-text-editor:not(.mini)':
  'ctrl-k right': 'custom:split-editor'
  1. Place bookmark at the current cursor position. (optional)
  2. Press: ctrl-k {release} right {release}
  3. The current code file is also opened in a new pane on the right.
  4. Navigate to the symbol in one of the panes.
  5. The two sides are linked.

Even if you loose your position, you have marked it with a bookmark in (1).
Other keymaps I have overrides the original bookmark shortcuts.
The keymaps (Windows OS) are:

'atom-text-editor:not(.mini)':
  'ctrl-k right': 'custom:split-editor'
  'ctrl-k ctrl-f': 'custom:fold-selected'
  'f2': 'bookmarks:toggle-bookmark'
  'shift-f2': 'bookmarks:jump-to-previous-bookmark'
  'ctrl-f2': 'bookmarks:jump-to-next-bookmark'
  'alt-f2': 'bookmarks:view-all'
  'ctrl-shift-f2': 'bookmarks:clear-bookmarks'

See if you find other packages of interest searching the principles mentioned before.
Your thoughts and feedback are welcome.