taplo icon indicating copy to clipboard operation
taplo copied to clipboard

VSCode extension formatting options require reloading

Open ShaiAvr opened this issue 1 year ago • 3 comments

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.

ShaiAvr avatar Oct 16 '24 05:10 ShaiAvr

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.

estyrke avatar Oct 17 '24 11:10 estyrke

@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

alichaudry avatar Nov 24 '24 22:11 alichaudry

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

there isn't one

panekj avatar Nov 24 '24 23:11 panekj