Skip to content

Add standardRuby.additionalLanguages for linting non-Ruby files#107

Open
marcoroth wants to merge 1 commit into
standardrb:mainfrom
marcoroth:non-ruby-files
Open

Add standardRuby.additionalLanguages for linting non-Ruby files#107
marcoroth wants to merge 1 commit into
standardrb:mainfrom
marcoroth:non-ruby-files

Conversation

@marcoroth

Copy link
Copy Markdown

The extension only forwarded ruby and Gemfile documents 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.additionalLanguages setting, 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/.yaml to the server.

CleanShot 2026-07-06 at 03 12 23@2x

This was inspired by both the rubocop-herb plugin 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:

image

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.

1 participant