SourceSeek READMESourceSeek is a tool for browsing C/C++ source code using the database of cscope/ctags/readtags created. It using the VSCode internerl interface of "Go to Definition", "Go to Reference", "Find All Reference", "Show Call Hierarchy" to navigate the code. It also provides a outline view to show the code structure of the current file. It has browser history window to show the browser history of the current project. It provides a preview window to show the code of the function when the mouse hover on the function name. It is to replace the VSCode C/C++ extension which is slow for large project like linux kernel. It uses the database created by cscope/ctags, so don't need to compile the code like the clangd extension. FeaturesBuilding the DatabaseWhen you open a directory/workspace, the cscope/ctags database will be automatically built on the first search. You can also generate it in advance via command line:
Outline WindowDisplays the function structure in the file, and can toggle to show only functions Jump to definition(F12)Go to Definition in context menu or F12 or Ctrl+Click on a symbol Jumps to the definition, if there are multiple definitions, shows an inline window Go to Reference(Shift + F12)Jumps to references, if there are multiple references, shows an inline window
Call Hierarchy Window(Shift+Alt+H)show the call hierarchy of the current function All References Window(Shift+Alt+F12)show all references of the current symbol Preview WindowWhen mouse hovering over a symbol, displays the definition in the right window It can also show code in a popup window beside the mouse pointer by changing setting You can also set to show preview in a hover window. By default, struct and macro will show in this window
Global SearchType # followed by a symbol prefix in the top bar to search for symbols across the entire workspace Text SearchDouble click on a word in edit window then right click to popup context menu and choose Search.
Browser History Record WindowThe history window records the history of symbols searched for definition jumps, Call Hierarchy, and references. It automatically saves in the workspace directory and loads the history record when reopened. You can also save to a file and load from a file using buttons. You can filter to show only functions. For symbol definitions, if a symbol has multiple definitions, they will be displayed in child nodes. For symbol call chains, the CALLERS OF window displays a call chain layer by layer, which is recorded in the history as child nodes. A call chain can be copied to the clipboard.
You can copy the call chain to the clipboard and paste it to other places.
When you go to a function, and then continue go to a sub-function and so on, the history will record the calling stack. Manually Map Function Pointer to DefinitionFor some function pointer calls, or multi-layer calls, you want to skip the intermediate calling process and directly call the key function. You can manually establish a function call link. Click the function name symbol in the definition, and pop up the menu (Link Caller/Mark Definition), click it, and pop up the menu, you can select the caller, or cancel the menu to just mark a definition, for choosing in Link Definition. Click the function name symbol in the definition, and pop up the menu (Link Definition/Mark Caller), click it, and pop up the menu, you can select the function name, or cancel the menu to mark a caller, for choosing in Link caller. The menu will also display the function names in the history record and the marked functions in dialog for choosing. You can right-click the menu to display the established call relationship The call relationship will be displayed in the OUTPUT window Status Bar Quick SettingsClick SourceSeek in the status bar to display several toggle switches A menu for on/off some settings
CommandsWindows and Linux versions of cscope/ctags/readtags commands are pre-installed in the extension. You can configure to use system-provided commands, that need set search path in system environment or specify the path for the commands in settings.
RequirementsIt depends on the cscope/ctags/readtags tools. Extension SettingsThis extension contributes the following settings:
Known Issuesmouse hover preview with tips is showing well Release Notes0.9.5
0.9.4
0.9.3
0.9.2
0.9.1
0.9.0
0.8.0
0.7.0
0.6.1
0.6
0.5.2
0.5.1
0.5.0
0.4.0
0.3.0
0.2.0
0.1.0
Following extension guidelinesEnsure that you've read through the extensions guidelines and follow the best practices for creating your extension. Enjoy! |