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

Fix undefined method Logger when processing watched file notifications #13822

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

vinistock
Copy link
Contributor

@vinistock vinistock commented Feb 12, 2025

The code for handling watched file notifications was crashing every time because it was trying to invoke Logger(), which is a module not a method. The actual method is Logger.log.

I added a test to verify that the runtime adapter is properly reloaded whenever the config file is updated.

Note: I did not use an RSpec's subject block for this test because we need to verify things inside the with_server block, while add-ons are still loaded and activated (the method unloads them at the end). The watched files notification doesn't return a response (because it's an LSP notification and not a request) and so this is the only way to verify what's happening.

Please let me know if you want to include this in the changelog.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

Sorry, something went wrong.

@koic
Copy link
Member

koic commented Feb 12, 2025

Thank you for finding the issue. Can you add a changelog entry? And the CI is failing, can you also fix it?

Verified

This commit was signed with the committer’s verified signature.
The code was trying to invoke `Logger()`, but that
is a class and the actual method is `Logger.log`
@vinistock vinistock force-pushed the vs-fix-undefined-method-logger branch from 2f9f9a6 to 5598046 Compare February 12, 2025 15:24
@vinistock
Copy link
Contributor Author

Done!

@koic koic merged commit b8f505f into rubocop:master Feb 12, 2025
23 checks passed
@koic
Copy link
Member

koic commented Feb 12, 2025

Thanks!

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.

None yet

2 participants