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

Allow RuboCop hints for non-ruby files #1323

Open
1 task done
Earlopain opened this issue Jan 22, 2024 · 2 comments
Open
1 task done

Allow RuboCop hints for non-ruby files #1323

Earlopain opened this issue Jan 22, 2024 · 2 comments
Labels
enhancement New feature or request pinned This issue or pull request is pinned and won't be marked as stale

Comments

@Earlopain
Copy link
Contributor

This feature is VS Code specific

  • VS Code specific

Use case

Somewhat recently RuboCop introduced 3rd-party templating support, where extensions can extract ruby code from files that RuboCop would normally not understand. rubocop/rubocop#10839

A few examples are

Description

I want inline RuboCop hints for non-ruby files.

Implementation

I'm not sure how this works, currently there is no request fired when opening an erb file for example. So the extension probably needs to advertise on which extensions it can function. I'm not sure how that would work with arbitrary extensions.

@Earlopain Earlopain added the enhancement New feature or request label Jan 22, 2024
@andyw8
Copy link
Contributor

andyw8 commented Jan 24, 2024

Transfering to the other repo since I don't think this is specific to VS Code.

@andyw8 andyw8 transferred this issue from Shopify/vscode-ruby-lsp Jan 24, 2024
@vinistock vinistock added the pinned This issue or pull request is pinned and won't be marked as stale label Jan 25, 2024
@vinistock
Copy link
Member

This is an interesting idea and highly related with ERB support #1055.

The challenge here is that the server needs to know how to process all of these different file extensions properly.

We will need to explore ways in which addons can register for handling a specific file type.

In addition to handling the embedded Ruby portions of the code, we also need to delegate requests that occur outside of it to their respective LSP. For example, for HTML, we would only want to handle Ruby related features, but we still want the HTML features to be available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pinned This issue or pull request is pinned and won't be marked as stale
Projects
None yet
Development

No branches or pull requests

3 participants