EEVblog Electronics Community Forum

Products => Computers => Programming => Topic started by: westfw on October 01, 2019, 02:15:42 am

Title: Source Code Repositories...
Post by: westfw on October 01, 2019, 02:15:42 am
Are there any online source code repositories (like github) that include some code-browsing features beyond syntax-coloring?I'd particularly like "goto defintion."  It would be fine if I have to use an offline tool to manually build the index...
Title: Re: Source Code Repositories...
Post by: Nusa on October 01, 2019, 02:43:13 am
That's the sort of feature that's normally handled by downloading the code and looking at it via your preferred editing environment. The online viewing tools for github aren't really intended for serious digestion of the code.
Title: Re: Source Code Repositories...
Post by: SparkyFX on October 01, 2019, 03:18:22 am
The question kind of overlaps with code documentation, there are documentation generators (https://en.wikipedia.org/wiki/Comparison_of_documentation_generators) that might provide the function you search for. If it ends up in the repository, it might still be browseable.
Title: Re: Source Code Repositories...
Post by: ataradov on October 01, 2019, 05:06:24 am
There are a number of Linux kernel cross reference sites. https://elixir.bootlin.com/linux/latest/source is one of them.

But yeah, it is easier to download stuff from GitHub rather than look for a sire that has the code you want to look at.
Title: Re: Source Code Repositories...
Post by: SiliconWizard on October 01, 2019, 06:22:06 pm
Well, if you're fine with using an offline tool, as said above, just use one?

Some editors allow to directly manage repositories (such as git and others) directly from within them, so that makes it easier than downloading the source code manually if you so wish. But of course the code will still be downloaded. And many of them have more than syntax coloring.

As Sparky said, othewise, doc generators will pretty much do what you seem to want. Doxygen is very well known here. There are others.

Title: Re: Source Code Repositories...
Post by: Sal Ammoniac on October 02, 2019, 04:36:56 pm
Are there any online source code repositories (like github) that include some code-browsing features beyond syntax-coloring?I'd particularly like "goto defintion."  It would be fine if I have to use an offline tool to manually build the index...

I doubt you're going to find anything like this. The two biggest players, GitHub and BitBucket, certainly don't support it. Unless the repository is huge and you have limited bandwidth, the simplest thing to do is clone the repo locally and browse it with VSCode, Sublime, etc.
Title: Re: Source Code Repositories...
Post by: SiliconWizard on October 02, 2019, 10:11:49 pm
Yeah, unless you set up your own server with only your own projects, analyzing code for millions of projects would be an almost impossible task for those public repositories... just think about it...