You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The "jump to definition" feature was first introduced June 11, 2019.
Sometimes it would be helpful to permalink to a definition: within a static file, with a static name, but a dynamic line number.
Random example: If I wanted to link to the
SyntaxNode
Interface
in thelib/binding_web/tree-sitter-web.d.ts
file in thetree-sitter
repo:Currently the only "direct" way to do so is via line number:
https://github.com/tree-sitter/tree-sitter/blob/master/lib/binding_web/tree-sitter-web.d.ts#L57
I could instead use a search link, which works reasonably well in this particular instance, but wouldn't in many repos, which would have lots of results includes docs & tests (granted, some of those could be filtered out using the language filter):
https://github.com/tree-sitter/tree-sitter/search?q=SyntaxNode
I'm proposing something like the following (exact syntax TBD), where
D
stands for "definition":https://github.com/tree-sitter/tree-sitter/blob/master/lib/binding_web/tree-sitter-web.d.ts#D:SyntaxNode:Interface
Related: Creating a permanent link to a code snippet
Beta Was this translation helpful? Give feedback.
All reactions