ReSharper 2021.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 displays a popup suggesting to escape all illegal characters. To accept this suggestion, press Alt+Enter or press Esc to reject it.

For example, when you paste a piece of text that contains double quotes into a string literal, ReSharper suggests to automatically escape all the quotes:

ReSharper automatically escapes double quotes in pasted string.

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

ReSharper automatically escapes angle brackets in pasted string.

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.NETLanguage: C++Language: HTMLLanguage: ASP.NETLanguage: RazorLanguage: JavaScriptLanguage: TypeScriptLanguage: CSSLanguage: XMLLanguage: XAMLLanguage: ResxLanguage: Build ScriptsLanguage: ProtobufLanguage: JSON
Feature is available in C#Feature is available in Visual Basic .NETFeature is available in C++Feature is available in HTMLFeature is available in ASP.NETFeature is available in RazorFeature is available in JavaScriptFeature is available in TypeScriptFeature is available in CSSFeature is available in XMLFeature is available in XAMLFeature is available in Resource filesFeature 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 details specific to other languages, see corresponding topics in the ReSharper by Language section.

Last modified: 08 March 2021