Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for FormattingOptions in config.toml #72

Open
djmoch opened this issue Apr 27, 2024 · 1 comment
Open

Add support for FormattingOptions in config.toml #72

djmoch opened this issue Apr 27, 2024 · 1 comment

Comments

@djmoch
Copy link

djmoch commented Apr 27, 2024

Currently, when acme-lsp sends a Formatting command to the server, it implicitly provides the zero-value for FormattingOptions, amounting to a TabSize = 0 and InsertSpaces = false.

When using the YAPF plugin with python-lsp-server, these values override the configured behavior. In my case, I'd like to adhere to the PEP-8 standard, which would require TabSize = 4 and InsertSpaces = true.

Given all of that, I'd like to propose adding per-server support for FormattingOptions. The result would be something like:

[Servers]
	[Servers.pylsp]
	Command = ["pylsp", "-vvv"]
	StderrFile = "pylsp.stderr.log"
	LogFile = "pylsp.log"

		# These settings get passed to pylsp
		[Servers.pylsp.Options]
		"pylsp.plugins.autopep8.enabled" = false
		"pylsp.plugins.yapf.enabled" = true

		# These settings get passed on Format
		[Servers.pylsp.FormattingOptions]
		TabSize = 4
		InsertSpaces = true

If this seems reasonable, I'd be happy to open a PR to add this.

Please let me know your thoughts.

@farhaven
Copy link
Contributor

I'd love that. I'm running into a similar scenario when editing Typescript stuff, and my muscle memory trips me up about once a day on this.

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

No branches or pull requests

2 participants