Closed HomelessCoder closed 2 years ago
Could you give me the exact version of the extension that's being used? You can get the exact version of the extension by bringing up the list of installed extensions and hovering over it:
Seems the same as yours - 0.1.44
Strange. It appears that there's something more to it than the sample code provided, because this is how it formats your code as an expression:
let
validateUrlScheme = (url as text) as text =>
if (Uri.Parts(url)[Scheme] <> "https") then
error "Url scheme must be HTTPS"
else
url
in
1
And as a section document:
section foobar;
validateUrlScheme = (url as text) as text =>
if (Uri.Parts(url)[Scheme] <> "https") then
error "Url scheme must be HTTPS"
else
url;
Does this match with your experience? It could be that you're code is a snippet of something larger which doesn't give the full context. For example one variable used during formatting is line length, and if it's a snippet it probably had additional indentation.
It's a part of the larger code, yes. But I've just created a new file:
The same behavior with a fresh vscode and the only extension installed :(
Okay, I think I know what the difference is. Under the VSCode extension what happens if you turn on the experimental checkbox?
Oh, you're right! Much better now :+1: Still, a completely different format compared to the previous version, so I have the whole file changed in git...
I understand that the vscode extension is actively developing, and I appreciate your efforts. But could you clarify if the format/code style will be subject to further big changes? I mean, git tracking is getting a bit confusing, and maybe we should consider stopping using auto-formatting on save for a while.
We planned one big formatter change, though the non-experimental mode seems to have a regression regarding verticality. I'd recommend using the experimental mode as it's closer to what the intended format is going to be here on out.
Ok, thanks!
Do you think it's worth keeping this ticket open to track the progress on the non-experimental mode? If not - I don't mind if you close it.
I'm going to close it as we'll be making the experimental formatter the default formatter. Thank for bringing the issue up to begin with, it helped us re-prioritize the experimental formatter.
Expected behavior The code is formatted and well-readable.
Actual behavior The code is formatted, but not readable or too expanded.
To Reproduce
Additional context This is a simple example. We have a file with ~250 rows, which has grown to 100%. The issue began a few days ago. Not sure when exactly, but I guess on the
powerquery.vscode-powerquery
extension update from 08/09/2022, 16:30:25.Could you do something with this, please? Would be nice to have some formatting settings at least to disable such an over-extended version.
Thanks!