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

Migrate .rubocop.yml watching to the server #1457

Open
vinistock opened this issue Mar 5, 2024 · 1 comment · Fixed by #1972
Open

Migrate .rubocop.yml watching to the server #1457

vinistock opened this issue Mar 5, 2024 · 1 comment · Fixed by #1972
Labels
enhancement New feature or request help-wanted Extra attention is needed pinned This issue or pull request is pinned and won't be marked as stale

Comments

@vinistock
Copy link
Member

We currently watch for changes in .rubocop.yml from the extension and simply restart the server in case the configuration was modified.

We should migrate the file watching so that it's initiated from the server, making it available in other editors too. Furthermore, we don't need to restart the server, but rather just re-initialize the RuboCop runner object to use the new configs.

Implementation

  1. We need to send another request for file watching like this one, but instead requesting to watch the .rubocop.yml file.
  2. When we receive the notification that a file has been modified, we need to add a specific check for .rubocop.yml here
  3. We need to somehow update the configurations used by the RuboCop runner, which are initialized here. Alternatively, if there's no way to reconfigure the same runner instance, we might be able to re-initialize the singleton, which will do the right thing
@vinistock vinistock added enhancement New feature or request help-wanted Extra attention is needed pinned This issue or pull request is pinned and won't be marked as stale labels Mar 5, 2024
Earlopain added a commit to Earlopain/ruby-lsp that referenced this issue Apr 9, 2024
This will make it trivial to reload the rubocop config for Shopify#1457 without doing an
awkward `Singleton.__init__`.
With `GlobalState` being a thing now, I don't see the need for a singleton
Earlopain added a commit to Earlopain/ruby-lsp that referenced this issue Apr 9, 2024
This will make it trivial to reload the rubocop config for Shopify#1457 without doing an
awkward `Singleton.__init__`.
With `GlobalState` being a thing now, I don't see the need for a singleton
vinistock pushed a commit that referenced this issue Apr 10, 2024
This will make it trivial to reload the rubocop config for #1457 without doing an
awkward `Singleton.__init__`.
With `GlobalState` being a thing now, I don't see the need for a singleton
@Earlopain
Copy link
Contributor

@vinistock I notice that this was accidentally closed by the attached PR

@andyw8 andyw8 reopened this May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help-wanted Extra attention is needed pinned This issue or pull request is pinned and won't be marked as stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants