-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #11033. ## Summary This PR changes warning message for `Lint/Syntax` between LSP and the command line. The redundancy of the offense message probably depends on the context. The context in which the issue has been reported is LSP. In LSP, source code being typed may still be evaluated as invalid syntax. On the other hand, when executed via the `rubocop` command line, the input is usually complete and evaluated as valid syntax in most cases. This means that suggesting a possible misconfiguration in .rubocop.yml would be sufficient only when using the command line. So, this is because the difference in evaluation timing of source code. Therefore, it is implemented as a distinction based on the execution context, rather than as a configuration option. ## Additional Information To resolve this, it seems reasonable to switch the context of the message between LSP and the `rubocop` command line. As for implementation, while the issue in Solargraph won't be directly resolved, considering a switch to RuboCop's built-in LSP could be an option. This PR adds the `RuboCop::Base#lsp_mode?` method, which is intended to be used for the LSP mode expansion I'm currently considering. The LSP still can be carved, and I think there is potential to make RuboCop's LSP more user-friendly and improve it.
- Loading branch information
Showing
5 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters