Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Enhancement request: allow specifying binary/path for formatters #794

Open
@borring

Description

@borring

Your environment

  • vscode-ruby version: 0.28.0
  • Ruby version: 3.0.0
  • Ruby version manager (if any): NONE
  • VS Code version: 1.63.2
  • Operating System: Fedora 35 (linux)
  • Using language server? (eg useLanguageServer is true in your configuration?) yes

ISSUE

The "ruby.format" only accepts a set of strings or a boolean. Please allow specifying the binary used for formatting.

SOLUTION

Follow the same pattern as Linters, where the config contains an instance of RubyCommandConfiguration
The standard linter follows such a pattern:

get cmd(): string {
	if (this.lintConfig.command) {
		return this.lintConfig.command;
	} else {
		const command = 'standardrb';
		return this.isWindows() ? command + '.bat' : command;
	}
}

The Standard formatter, instead, has the commands hardcoded

get cmd(): string {
	const command = 'standardrb';
	return this.isWindows() ? command + '.bat' : command;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImproves upon existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions