Cross Referencer for github repositories - github

I have used the free-electrons elixir cross referencer to browse through the linux source code and be able to jump to the definition and implementation of the defined functions, etc.
I was wondering if there is a similar cross referencer for github repositories
Thanks

There is a website that does this, though I am not sure if they index the implementations and declarations like elixir does for linux kernel . Sourcegraph can help you with this.
For example if you wanted to view the linux kernel you would type
https://sourcegraph.com/github.com/torvalds/linux

Since June 11th, 2019 (2 years later), you don't need Sourcegraph.
See "Jump to definition in public repositories"
Jump to definition is now available for a subset of public repositories—supported in Go, JavaScript, Python, Ruby, and TypeScript.
Hovering over function and method calls will expose jump-to-definition links for all call sites in the blob content, within the same repository.
We use the recently open-sourced semantic library to find definitions and call sites in your code.
See more at "Navigating code on GitHub":
Tip: Jump to definition works for active branches.
If the feature is enabled for you but you don't see links to the definitions of functions and methods, push to the branch and try again.
See it in action for instance in moby/moby cmd/dockerd/daemon.go.
Starting August 2019, you can "Find all references in public repositories"
Find all references is now available for a subset of public repositories—supported in Go, JavaScript, PHP, Python, Ruby, and TypeScript.
Hovering over function and method names in the code view will expose links to all of the calls to that function or method within the same repository.
We use the recently open sourced semantic library to find definitions and call sites in your code: github/semantic
semantic is a Haskell library and command line tool for parsing, analyzing, and comparing source code.

Related

Intellisense for Python keywords in Robot Framework not working in VS Code

I did my best to overcome this problem but it was in vain. I am developing tests in Robot Framework (RF) in Visual Studio Code and I want it to either show "signatures" of keywords from standard libraries or to be able to go to their definitions. Go to definition and signature displaying when hovering with Ctrl key are behaving this way:
works for my keywords written in RF (hoorah!)
works for my keywords written in Python only if a keyword consists of one word (I think conversion between undescores and spaces is failing)
does not work for keywords from standard libraries even if the keyword is one-word (e.g. "Fail"), regardless whether the keyword comes from built-in libraries or other ones (e.g. SeleniumLibrary)
When failing, Robot Framework Intellisense Server gives me message "Keyword definition 'Blah Blah' not found from the workspace".
I am using plugins Robot Framework Intellisense FORK and/or Robot Framework Language Server. I tried to configure them carefully according their documentation (Details), but the best state I reached is described above.
Can you help me please? I do not need to use a specific plugin, I just need to have the signature or documentation (or implementation) of every keyword in my code to be one click far.
According to their documentation they support
Goto definition
For variables
For user keywords
I was able to partially solve this when I not only open the folder with source code, but create a workspace and add the folder containing standard libraries to it as well (Add Folder to Workspace). I do not know exactly which folder is the best to add, it seems ...\Python\Python37\Lib\site-packages\ to me.

Variable, Class, function etc. inspector for Atom

For visual studio code, there exists some addon/plugin which shows you the origin for example of an included class, the return value of a function etc..
I find it very handy, but I want this functionality in atom since I prefer atom.
How does one call this kind of plugin/addon, so I can look for it on google?
And ideally, what addon/plugin supports this feature best.
If I understood you correctly, the functionality name is IntelliSense.
About IntelliSense used in VS code, you can read here.
Actually you must do your research depending on programming language you use. I.e. if you're using js you must search javascript Intellisense atom and find it in first link

How to tell python 2 or 3 in Github?

I feel like this is a feature request/question for Github devs but since Github by default doesn't show you python 2 or 3 (but instead just python), how to easily tell other than cloning it or browsing in source code, assuming the Repo. document doesn't say (and often they just show pip without specifying whether it is pip2 or pip3. I know I can just do pip search as well as I prefer if I can just see it right in the browser.
Maybe there is a chrome plugin but my googfu has no luck finding it thus far.
It seems that you are asking for GitHub to tell you if a project or repository is Python 2.x or Python 3.x, and that is just not reasonably possible. If it is available through pip (pip2 or pip3) you can query that way (already mentioned), but it is worth explaining why GitHub cannot do what you ask :
Python packages, projects, and/or code are not Python 2.x or Python 3.x (exclusive or), rather, it is possible two write code that works with either.
GitHub could try to infer the prevailing version of Python within a repository, however, if they did so programmatically (even using sophisticated AI) it would be wrongs far too often.
GitHub could try to force users to pick one, which would alienate many, frustrate many more, and generally provide no significant benefit to the community.
Even if GitHub forced folks to choose, it is surprisingly common for authors to know know if their code will work fully in one version or the other.
Although you could envision GitHub trying to enforce designating repositories as "Python 2.x" or "Python 3.x", this makes little sense (see first bullet item) and would give the Python ethos community a severe allergic reaction since it's antithetical to the culture.
TL;DR: Github currently doesn't support distinguishing between Python 2 and 3 in the repository language statistics.
Assuming you're referring to the Github language statistics on the front page of a repository (see screenshot of example repo below with red box around programming language statistics):
This will not distinguish between Python 2 and Python 3 code. Apart from cross-compatability reasons, part of the reason why is that Python 2 and Python 3 code files sometimes share the same file extension names, and the Linguist library which is used to calculate these statistics does not differentiate between them.
You can see this section of the languages.yml file in the Linguist Github repo to see what's considered a Python file or not. Note that there's no distinction anywhere in the languages.yml between Python 2 and Python 3 code.

Goto definition like feature in custom (user-defined) language in notepad++

Is there any way (by means of plugins or settings) to create (by that I mean modifying, adding & deleting) custom tags in notepad++?
By tags I mean, to jump to the definition of an instance used anywhere in project (some kind of like 'goto definition' function like we have in other popular languages like C, C++, C#).
I searched for this topic but could not find satisfactory result.
My requirement:
I have created a custom language in Notepad++ (by adding keywords, coloring patterns and other rules). Now I need the way to add custom tags for this language. How can I achieve this?
With the help of tags I should be able to navigate to definition (just like goto definition in other popular languages) in the particular project (all files in project or at least opened files).
Now I need the way to add custom tags for this language. How can I achieve this?
If you're using Exuberant Ctags you can configure a new language definition using just a handful of regular expressions.
For example this link shows how to configure ctags for the Clipper language using this regexp approach:
I have just had to deal with essentially the same issue. I am using Notepad++ with a legacy codebase written in a custom markup language. Each file can contain cross references to definitions in other files, so a way of jumping to the definition would be very useful.
It has not been easy to find a solution that meets all four requirements: a goto definiton feature that works across multiple files and for a custom language in Notepad++. I found this question while searching for a solution; the answer jussij provided is good but it does not really provide a complete solution.
I ended up using the SourceCookifier plugin with a custom language definition. There is not a huge amount of guidance online about how to use it, but once installed you can use it to manually create a language definition using regex rules.
SourceCookifier will work for your language if you can configure the following:
A set of file extensions used by the language
A set of tag types (i.e. a function, class, variable)
A set of POSIX Basic Regular Expressions for locating each tag type, see this post
Once a language has been defined, you can highlight any instance of a found tag and use the shortcut Ctrl+Shift+Enter to jump to the definition of that tag. This can work across a whole codebase of files if you provide it with a list of files to inspect, it calls this a 'session'. All you need to do is drag and drop your codebase folder into the SourceCookifier sidebar window. The codebase I was working with is very large, so I am only using basic functionality, see this post for a good explination of that. The goto definition shortcut can also be added to a right-click context menu, see this post.

Need brief understanding on how eclipse autocomplete works

Hi I am interested in understanding how eclipse autocomplete works. I want to understand how eclipse distinguishes between local and global variables in a piece of Java code. I would also like to understand how eclipse stores method signatures for an infinite number of classes and how it associates a method to a given class. And is it possible for one person to develop an autocomplete feature for a language like JavaScript.
There is already an AutoComplete feature for Javascript. You just need to let Eclipse install the appropriate extensions.
Eclipse maintains a model of your program, including the project and all the dependencies. It's big, but it's not infinite. When you hit the dot, it figures out based on the variable type what the target type can be, and then displays the relevant methods based on its internal model.
This is easy for Java because you can usually know the static type. Much harder in other languages.
The Eclipse plug-in developer's guide discusses how different things, including the internal model and auto completion works. There are extension points to implement yiur own.