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

VSCode extension formatting options require reloading #687

Open
ShaiAvr opened this issue Oct 16, 2024 · 3 comments
Open

VSCode extension formatting options require reloading #687

ShaiAvr opened this issue Oct 16, 2024 · 3 comments

Comments

@ShaiAvr
Copy link

ShaiAvr commented Oct 16, 2024

I am trying to edit my pyproject.toml file, and I am playing with the extension's formatting options, but I have a weird issue. The formatting options don't apply until I restart or reload the editor.

For example, in my settings.json file I have "evenBetterToml.formatter.allowedBlankLines": 1 which works as expected: if I have more than one blank line, they're collapsed into a single blank line when I save or format pyproject.toml. However, now I change the setting to 3 and add some blank lines. When I save the file, the blank lines are again collapsed into a single blank line instead of 3. When I reload the editor (Developer: Reload Window) or restarts it, then the new setting applies and multiple blank lines collapse to 3 blank lines.

This happens with any time I change the formatting options. The old options still apply when I save or format the file, and only after reloading or restarting the editor, the new settings apply.

I think this is a bug, and if it's not, then it should still be changed. It's very frustrating to reload the editor every time I want to change the formatting options.

@estyrke
Copy link

estyrke commented Oct 17, 2024

It's the language server that needs to be restarted. Many extensions provide a command for this, but this extension does not (e.g. TOML: Restart Server). The extension could also try to detect when the server needs to be restarted, but that's probably trickier.

I'd not say it's a bug per se, more of a missing feature. And I agree it's frustrating.

@alichaudry
Copy link

@estyrke mind sharing how I can find the TOML: Restart Server toggle? I'm only able to get the settings to propagate via the Developer: Reload Window option that @ShaiAvr mentioned.

These are the only options I see for TOML:

image

@panekj
Copy link
Collaborator

panekj commented Nov 24, 2024

mind sharing how I can find the TOML: Restart Server toggle?

there isn't one

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

4 participants