Add standardRuby.additionalLanguages for linting non-Ruby files#107
Open
marcoroth wants to merge 1 commit into
Open
Add standardRuby.additionalLanguages for linting non-Ruby files#107marcoroth wants to merge 1 commit into
standardRuby.additionalLanguages for linting non-Ruby files#107marcoroth wants to merge 1 commit into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The extension only forwarded
rubyandGemfiledocuments to the Standard language server, so custom RuboCop cops that lint other file types (a YAML data validator, an ERB linter, ...) never received their files.This pull request adds a new
standardRuby.additionalLanguagessetting, an array of VS Code language identifiers that extends both the document selector and the supported-language check. It defaults to[], so nothing changes unless a project opts in; e.g.["yaml"]routes.yml/.yamlto the server.This was inspired by both the
rubocop-herbplugin I'm working on and more recently, this pull request in RubyEvents (rubyevents/rubyevents#1879) where we wanted to use the existing RuboCop/Lint Roller architecture to surface offenses from our custom Validator directly in the Editor: