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

Add Basic RBS Support #2775

Open
andyw8 opened this issue Oct 24, 2024 · 2 comments
Open

Add Basic RBS Support #2775

andyw8 opened this issue Oct 24, 2024 · 2 comments

Comments

@andyw8
Copy link
Contributor

andyw8 commented Oct 24, 2024

We rely on RBS for features such as documentation and completion for Ruby's own API.

For example, in VS Code, if you right-click on String.pp and choose "Go to Definition", the editor will show results for kernel.rbs and string.rbs.

But if you open that file, you'll notice there is no syntax highlighting, and no other Ruby LSP features are available.

We can add some improvements. These will work similar to the corresponding Ruby features, but since the RBS syntax is simpler, they should be much easier to implement.

(For now we are focusing on reading/navigation RBS, rather than writing it.)

Grammar file

We can base this off the existing VS Code extension for RBS:
https://github.com/soutaro/vscode-rbs-syntax/blob/master/syntaxes/rbs.tmLanguage.json
(or perhaps this).

We can also add tests, similar to the tests we have for Ruby grammar here.

Go To Definition

For an RBS signature which references another type, we can implement Go To Definition to provide easy navigation.

Hover

Hovering over a type can show any documentation comments.

DocumentSymbol

Similar to what we do for Ruby code, we can implement DocumentSymbol for RBS to power features such as Outline and Go To Symbol.


(this issue is a subset of #1206)

@ybiquitous
Copy link
Contributor

Hi, this effort should be great for so many Rubyists! 👏🏼

JFYI, the grammar file in soutaro/vscode-rbs-syntax is also used by GitHub Linguist:

Copy link
Contributor

This issue is being marked as stale because there was no activity in the last 2 months

@github-actions github-actions bot added the Stale label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants