Open davidwengier opened 1 year ago
It makes more sense (IMO) for the client to implement these settings and simply not issue the requests. Format on Paste especially, because it is indistinguishable from a Range Formatting request. Such is the model that existed for language services registered through pkgdef, which included being able to enable/disable completion, quickinfo (hover), and a few other features. For LSP, it may make sense to expand the set of language features for which the client exposes an option, and the registration of those options hopefully can be modernized or streamlined for LSP...
100% agree
Format on paste is the main reason I have to hit Ctrl + Z
hundreds of times per day. Doing a line copy and paste formats both the copied line and pasted line:
@olegtk @kayle @joseparrams FYI on this since platform controls the Format on Paste in LSP (but also see my comment above about modernizing all the other features previously supported via Language Service registration in pkgdef, since those are also client-initiated features in LSP). This also relates to our internal discussion of consolidating and simplifying settings for LSP vs other VS Editor extensibility.
Tracking as internal ask with Bug 1803701: Allow "Format On Paste" to be disabled for LSP
So this just keeps getting kicked down the road? Format on Paste is so frustrating, it forces you to wait up to a second before the format occurs just so you can hit undo. The only workaround is to quickly type a character which prevents the automatic format.
Any update on this, over a year later? This bug is the main reason I hate Visual Studio.
Unfortunately this fix can only be done by the Visual Studio editor team, so all we can do is ask and wait. It is one of our highest priority requests from them however.
8 GB of updates today and Paste still sucks in Razor.
17.9 has come and gone, we can only hope something will be done in 17.10.
@michaelcsikos if you want to comment in a way that is visible to the team that needs to fix this issue, then https://developercommunity.visualstudio.com/t/CSHTML-File-Format-Problem/10398165 is a much better place.
OK. So, that bug was reported 8 months after this thread and it has 2 votes. The search for the Developer Community is abysmal, but that's a different issue.
Along with https://github.com/dotnet/razor-tooling/issues/4336, once https://github.com/dotnet/razor-tooling/issues/6212 is done we should add an option to turn off formatting on paste.
Currently this is, as far as I know, completely done on the platform side, so not sure if we already have a facility to tell them not to format, but we should investigate and request something if not.
See related user feedback here: https://github.com/dotnet/razor-tooling/issues/6212#issuecomment-1290019797