ReSharper 2024.1 Help

Smart Paste

ReSharper helps you automatically escape illegal characters in text that you copy/paste around your code.

If the pasted text contains characters that are illegal for the current context ReSharper automatically replaces these characters with the corresponding escape sequences.

You can press Ctrl+Z immediately after pasting to undo the escaping and keep the pasted text as is.

For example, when you paste a piece of text that contains double quotes into a string literal, ReSharper automatically escapes all the quotes.

Another example is pasting a piece of code with generics into an XML doc tag: ReSharper will replace angle brackets with the corresponding escape sequences.

When pasting text inside comments, ReSharper will escape */ when pasted into multiline comments and replace newlines with indent and // or /// when pasted into line or XML-doc comments.

This feature is supported in the following languages and technologies:

Language: C#

Language: VB.NET

Language: C++

Language: HTML

Language: ASP.NET

Language: Razor

Language: JavaScript

Language: TypeScript

Language: CSS

Language: XML

Language: XAML

Language: Resx

Language: Build Scripts

Language: Protobuf

Language: JSON

Feature is available in C#

Feature is available in Visual Basic

Feature is available in C++

Feature is available in HTML

Feature is available in ASP.NET

Feature is available in Razor

Feature is available in JavaScript

Feature is available in TypeScript

Feature is available in CSS

Feature is available in XML

Feature is available in XAML

Feature is available in Resource files

Feature is available in build script files

Feature is not available in Protobuf

Feature is not available in JSON

The instructions and examples given here address the use of the feature in C#. For more information about other languages, refer to corresponding topics in the ReSharper by language section.

Last modified: 15 April 2024