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

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

Open
borring opened this issue Feb 9, 2022 · 0 comments
Open

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

borring opened this issue Feb 9, 2022 · 0 comments
Labels
enhancement Improves upon existing functionality

Comments

@borring
Copy link

borring commented Feb 9, 2022

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;
}
@wingrunr21 wingrunr21 added the enhancement Improves upon existing functionality label Mar 12, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
enhancement Improves upon existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants