'What notations are available for language-agnostic references to declarations for documentation purposes?

I'm looking to build a tool which can link parts of a codebase to different parts of our documentation, so we can automatically collect relevant docs to review for a given change.

The code we want to reference can consist of HTML, JavaScript, Java, Scala, and C#. I'd like to use a single notation for any code references, and I'd also like to reference the code by symbols/signatures instead of line ranges.

What are some existing notations for this sort of reference?

I can come up with my own trivial notation, but am interested in existing solutions which might handle some cases I haven't thought of.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source