Depending on what you mean by “keywords”, there’s somewhat of an API for this, but nothing that directly tells you every symbol that’s in the current work space directly. Depending on what it is you have in mind, this may or may not help you out.
For example, Goto > Goto Symbol
in the menu opens the Goto Anything
panel that shows you the symbols defined in the current file so you can jump to them. The view.symbols()
method in the API will fetch you the same list of symbols as is displayed in that case, along with their locations.
On the other hand, Goto > Goto Symbol in Project
opens a different popup that shows you the global list of symbols from all files that are indexed instead of just for the current file. In that case the API has window.lookup_symbol_in_index()
and window.lookup_symbol_in_open_files()
, but both of them work in the opposite direction; you tell them what symbol you’re interested in and it tells you where you can find it.