Skip to content

Add option for format on paste#11039

Merged
ryzngard merged 5 commits intodotnet:mainfrom
ryzngard:format_on_paste_option
Oct 19, 2024
Merged

Add option for format on paste#11039
ryzngard merged 5 commits intodotnet:mainfrom
ryzngard:format_on_paste_option

Conversation

@ryzngard
Copy link
Copy Markdown
Contributor

Fixes #7025

image

@ryzngard ryzngard requested a review from a team as a code owner October 17, 2024 02:50

if (formatOnType)
{
return FormattingFlags.All;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't this FormattingFlags.OnType ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it would be FormattingFlags.Enabled | FormattingFlags.OnType but I didn't add something for paste

Copy link
Copy Markdown
Member

@davidwengier davidwengier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You beat me to it! Thank you <3

parsedEnableFormatting is not null)
{
enableFormatting = GetObjectOrDefault(parsedEnableFormatting, enableFormatting);
formatting = GetObjectOrDefault(parsedEnableFormatting, formatting);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this still be parsed as a bool, and then converted to FormattingFlags.Enabled as necessary? Or are you planning on changing the VS Code option?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doi, yes. Just blanket chnaging things. Should still be a bool in vs code

@ryzngard ryzngard enabled auto-merge (squash) October 18, 2024 22:45
@ryzngard ryzngard merged commit 019b7c8 into dotnet:main Oct 19, 2024
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Oct 19, 2024
akhera99 added a commit to akhera99/razor that referenced this pull request Oct 22, 2024
akhera99 added a commit to akhera99/razor that referenced this pull request Oct 22, 2024
333fred added a commit to 333fred/razor that referenced this pull request Oct 23, 2024
* upstream/main: (290 commits)
  Add breaking changes document (dotnet#11064)
  Do not extract component into code block (dotnet#11069)
  Fix invalid setttings json (dotnet#11062)
  update MicrosoftSourceBuildIntermediatearcadePackageVersion
  Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2566512
  Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2566512
  Update source-build team references (dotnet#11032)
  Handle EditorRequired *Changed/*Expression parameters (dotnet#11043)
  Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2566213
  Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2566213
  Avoid ambiguous `object` reference in generic component recovery (dotnet#11053)
  Move culture info check (dotnet#11057)
  Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20241015.1
  Fix code actions integration tests
  Add option for format on paste (dotnet#11039)
  Update src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentDocumentClassifierPass.cs
  Fix merge to 17.12 version
  Update src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentDocumentClassifierPass.cs
  Ensure model directives are mapped at runtime (dotnet#11007)
  Fix @inherits mapping for fuse (dotnet#10985)
  ...
@phil-allen-msft phil-allen-msft modified the milestones: Next, 17.13 P1 Oct 31, 2024
@michaelcsikos
Copy link
Copy Markdown

This supposedly was released in 17.13, but it flat-out doesn't work, at all. See the feedback:
https://developercommunity.visualstudio.com/t/CSHTML-File-Format-on-Paste-Problem/10398165#T-N10848033

@davidwengier
Copy link
Copy Markdown
Member

Thanks for posting @michaelcsikos, I agree this doesn't seem to work for me in 17.13 either. I'll reopen the GitHub issue

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

Successfully merging this pull request may close these issues.

Add option to turn off Format on Paste

4 participants