Live data from Hacker News

Cscope: A developer's tool for browsing source code

cscope.sourceforge.net

21–30 of 37 posts

Re: Cscope: A developer's tool for browsing source code

#21

More direct link: https://sourceforge.net/projects/cscope/files/ I set the forward proxy automatically rewrite http://subdomain.sourceforge.net links into the above https:// format.

Hehe, I usually do the opposite, as the SourceForge project page usually contains very little information about the project in general and is usually harder to navigate than the home page.

Re: Cscope: A developer's tool for browsing source code

#23
post #8
post #6

What would be the workflow when using such tools like this or Source Trail? I've used cscope once while I'm testing out vim as my main text editor a bit. Nowadays I'm using the global search feature of vscode for code exploration. Combined with the available language server for each language, it seems to work well enough for me currently.

Cscope in vim to jump between caller and callee (examine relationship). See where symbols are used. Jump to global definition. Could not live without cscope!

Vim Youcompleteme plugin with libclang support does this better for me. Have you compared?

Re: Cscope: A developer's tool for browsing source code

#26
post #22

Earlier quoted context omitted.

By no means.

What has it got that makes it better than clang-complete/you complete me? I switched a few years ago, maybe i wasn't using all of cscope's strengths?

They are two different things; cscope is a source code browser while YouCompleteMe is for source code completion. The cscope features are listed on its home page.

The reason i like it is because it is implemented in the classic "Unix Tools" manner i.e. small, fast, self-contained, good feature set and easily integrated with many editors. Now of course you have lots more tools with similar functionalities but i find most to be too big and unwieldy with lots of dependencies and a pain to setup. If you have ever been forced to work on minimal systems with no Desktop GUIs, remote targets etc. you come to appreciate small powerful tools which you can carry with you everywhere.

Re: Cscope: A developer's tool for browsing source code

#27
post #18

Amazing that the last update was apparently 8 years ago. My workflow works better w ctags, but when ctags lack, cscope can usually fill the gap.

The changelog on that page is inaccurate, the last release was in 2018 (https://sourceforge.net/projects/cscope/files/cscope/v15.9/)

Re: Cscope: A developer's tool for browsing source code

#29
for purely c based codesbases i don’t think there is anything better that is freely available (would _love_ to hear about equivalent alternatives though. ctags etc don’t seem to have similar functionality afaik)

cacope has excellent emacs integration as well.

for c++, unfortunately, cscope was ok till about c++-98, but modern incarnation of the standard seem to have given rise to a slew of tools for code navigation.

most notable amongst them being around the notion of compilation databases and language servers etc. unfortunately though, for large codebases (>= 1 giga-lines) in my experience they don’t seem to offer anything better, and need to be used in conjunction with grep and their modern incarnations f.e ripgrep etc. making the entire workflow quite unwieldy...

Re: Cscope: A developer's tool for browsing source code

#30
I used Geany editor (well, it's a "lightweight IDE" GTK based, Scintilla powered) for its ctags integration.

Also helpful for exploration of unknown code. However, in general it navigates between files opened already (as it generates ctags on open). But allows loading an externally generated ctags file. Also does symbol usage lookup and auto-completion.

Post reply on HN