Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend the functionality of hover in rbs files. #397

Merged
merged 2 commits into from
Jul 20, 2021

Conversation

Yuuki77
Copy link
Contributor

@Yuuki77 Yuuki77 commented Jul 9, 2021

add hover supports for RBS::Types::ClassInstance, RBS::Types::ClassSingleton and RBS::Types::Interface.

When these are hovered, the information and comments will now be displayed!

image

How to test

crate a rbs file with this content and you can confirm that you can see the information when you hover them

# my comment
class Foo [T] < Parent[T]
end

class Parent [in T]
end

module Hoge
end

class Qux
  @foo: Foo[Hoge]
end

interface _Fooable
  def foo: () -> nil
end

class C
  def foo: (_Fooable) -> singleton(String)
end

Copy link
Owner

@soutaro soutaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of the code looks good.

location = type.location

InterfaceContent.new(
location: location,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use location[:name] here to highlight only name of the interface.

@Yuuki77
Copy link
Contributor Author

Yuuki77 commented Jul 12, 2021

@soutaro Thank you for the reviews!
I have updated it 1545d6b

@Yuuki77 Yuuki77 requested a review from soutaro July 13, 2021 01:46
Copy link
Owner

@soutaro soutaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪

@soutaro soutaro merged commit 43f896d into soutaro:master Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants