Vscode: minimalEditOperations can break formattings

Created on 6 Sep 2016  路  13Comments  路  Source: microsoft/vscode

Most helpful comment

It's a guess based on incomplete analysis. :smile:

Once there's a new insider's build, we'll know more.

All 13 comments

@egamma fyi

Thanks for digging into this @jrieken!

@jrieken What about formatting not working at all (rather than messing with characters)? Are we talking about the same thing?

Taken from the original issue:

I work with Unity, but no matter if I open a whole solution or only a .cs file: the formatting of the code with (Shift+Alt+F), or by using the action in the command palette, isn't working.

@nfantone Since I don't have reproducible steps for that it's guessing. However, no formatting can happen when the produced edits are really bad (overlapping etc). I am happy to dig further but I do need a repro.

Closing this issue which really was a regression from #10133

Why close this issue? Is it being tracked elsewhere?

@jrieken Sorry for not following you on this: have you closed the issue because if was fixed by https://github.com/Microsoft/vscode/commit/ce1f925f1614dc5273f1813a6506eadd09575ed4?

And also, what do you mean by not having "reproducible steps"? For starters, you have a complete project uploaded here from where you can replicate the issue. But, nevertheless, if you would like to see the formatter in action, just create a new C# project and start playing around with the "Format Code" option. It'll take you no more than two minutes to realize that formatting C# scripts just does not work on VSCode. If you _really_ need them for some reason, you can certainly create your own steps - like I did in my previous comment.

@nfantone: based on the analysis in https://github.com/OmniSharp/omnisharp-vscode/issues/660, I was guessing that the bad edits were hitting some fail safe in the editor that caused it to start ignoring the command.

@DustinCampbell All right. But which one is it? An analysis or a guess? Is this still happening on master? I tried updating Insiders to check it out but there's no new release, yet.

It's a guess based on incomplete analysis. :smile:

Once there's a new insider's build, we'll know more.

@DustinCampbell @jrieken I'm happily reporting that after updating Insider, formatting now works again on all my Unity projects! Cheers for that.

One minor thing: I had to remap my formatting binding on MacOSX from Shift+Option+F to something else, because that combination kept adding a non-printable character instead.

Now... if only there were a way of configuring format settings consistently across IDEs...

@DustinCampbell @jrieken Same here - formatting is now working as expected on all my Unity projects on Windows 10.
Thanks for the fix!
I am now enjoying VS Code more than ever before.

Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Perkovec picture Perkovec  路  191Comments

jez9999 picture jez9999  路  234Comments

stoffeastrom picture stoffeastrom  路  380Comments

Tyriar picture Tyriar  路  204Comments

hsdk123 picture hsdk123  路  263Comments