Skip to content

Linkify Ruby code references in terminal output #3951

Description

@amomchilov

I have checked that this feature is not already implemented

  • This feature does not exist

Use case

There are several common forms of references to Ruby code that might show up in the terminal, like:

# Default `Kernel#inspect` format
#<A::B::C:0x0000000123009050 @a=1>
/Users/alex/project/example.rb:12:in 'Baz#c': unhandled exception: NotImplementedError (NotImplementedError)
from /Users/alex/project/example.rb:8:in 'Bar#b'
from /Users/alex/project/example.rb:4:in 'Foo#a'
from /Users/alex/project/example.rb:15:in '<main>'

The file paths and line numbers are clickable, but not any of the Ruby code references.

Description

It would be great if RubyLSP would identify that A::B::C as a constant reference, Baz#c is a method in Baz, NotImplementedError is a class, etc., and let you go-to-def by command-clicking on these.

Implementation

It looks like TerminalLinkProvider API does exactly this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestpinnedThis issue or pull request is pinned and won't be marked as stale

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions