Skip to content

Commit 49bd1b0

Browse files
CR Feedback: Use better names for HTML and non-HTML scopes
1 parent 05dd376 commit 49bd1b0

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/RazorHtmlWriter.cs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -93,111 +93,111 @@ private void AddSourceMapping(SourceSpan original, SourceSpan generated)
9393

9494
public override void VisitRazorCommentBlock(RazorCommentBlockSyntax node)
9595
{
96-
using (IsNotHtml())
96+
using (NonHtmlScope())
9797
{
9898
base.VisitRazorCommentBlock(node);
9999
}
100100
}
101101

102102
public override void VisitRazorMetaCode(RazorMetaCodeSyntax node)
103103
{
104-
using (IsNotHtml())
104+
using (NonHtmlScope())
105105
{
106106
base.VisitRazorMetaCode(node);
107107
}
108108
}
109109

110110
public override void VisitMarkupTransition(MarkupTransitionSyntax node)
111111
{
112-
using (IsNotHtml())
112+
using (NonHtmlScope())
113113
{
114114
base.VisitMarkupTransition(node);
115115
}
116116
}
117117

118118
public override void VisitCSharpTransition(CSharpTransitionSyntax node)
119119
{
120-
using (IsNotHtml())
120+
using (NonHtmlScope())
121121
{
122122
base.VisitCSharpTransition(node);
123123
}
124124
}
125125

126126
public override void VisitCSharpEphemeralTextLiteral(CSharpEphemeralTextLiteralSyntax node)
127127
{
128-
using (IsNotHtml())
128+
using (NonHtmlScope())
129129
{
130130
base.VisitCSharpEphemeralTextLiteral(node);
131131
}
132132
}
133133

134134
public override void VisitCSharpExpressionLiteral(CSharpExpressionLiteralSyntax node)
135135
{
136-
using (IsNotHtml())
136+
using (NonHtmlScope())
137137
{
138138
base.VisitCSharpExpressionLiteral(node);
139139
}
140140
}
141141

142142
public override void VisitCSharpStatementLiteral(CSharpStatementLiteralSyntax node)
143143
{
144-
using (IsNotHtml())
144+
using (NonHtmlScope())
145145
{
146146
base.VisitCSharpStatementLiteral(node);
147147
}
148148
}
149149

150150
public override void VisitMarkupStartTag(MarkupStartTagSyntax node)
151151
{
152-
using (IsHtml())
152+
using (HtmlScope())
153153
{
154154
base.VisitMarkupStartTag(node);
155155
}
156156
}
157157

158158
public override void VisitMarkupEndTag(MarkupEndTagSyntax node)
159159
{
160-
using (IsHtml())
160+
using (HtmlScope())
161161
{
162162
base.VisitMarkupEndTag(node);
163163
}
164164
}
165165

166166
public override void VisitMarkupTagHelperStartTag(MarkupTagHelperStartTagSyntax node)
167167
{
168-
using (IsHtml())
168+
using (HtmlScope())
169169
{
170170
base.VisitMarkupTagHelperStartTag(node);
171171
}
172172
}
173173

174174
public override void VisitMarkupTagHelperEndTag(MarkupTagHelperEndTagSyntax node)
175175
{
176-
using (IsHtml())
176+
using (HtmlScope())
177177
{
178178
base.VisitMarkupTagHelperEndTag(node);
179179
}
180180
}
181181

182182
public override void VisitMarkupEphemeralTextLiteral(MarkupEphemeralTextLiteralSyntax node)
183183
{
184-
using (IsHtml())
184+
using (HtmlScope())
185185
{
186186
base.VisitMarkupEphemeralTextLiteral(node);
187187
}
188188
}
189189

190190
public override void VisitMarkupTextLiteral(MarkupTextLiteralSyntax node)
191191
{
192-
using (IsHtml())
192+
using (HtmlScope())
193193
{
194194
base.VisitMarkupTextLiteral(node);
195195
}
196196
}
197197

198198
public override void VisitUnclassifiedTextLiteral(UnclassifiedTextLiteralSyntax node)
199199
{
200-
using (IsHtml())
200+
using (HtmlScope())
201201
{
202202
base.VisitUnclassifiedTextLiteral(node);
203203
}
@@ -215,12 +215,12 @@ public override void VisitToken(SyntaxToken token)
215215
}
216216
}
217217

218-
private readonly ref struct WriterStateSaver
218+
private readonly ref struct WriterScope
219219
{
220220
private readonly RazorHtmlWriter _writer;
221221
private readonly bool _oldIsWritingHtml;
222222

223-
public WriterStateSaver(RazorHtmlWriter writer, bool isWritingHtml)
223+
public WriterScope(RazorHtmlWriter writer, bool isWritingHtml)
224224
{
225225
_writer = writer;
226226
_oldIsWritingHtml = writer._isWritingHtml;
@@ -233,11 +233,11 @@ public void Dispose()
233233
}
234234
}
235235

236-
private WriterStateSaver IsHtml()
237-
=> new(this, isWritingHtml: true);
238-
239-
private WriterStateSaver IsNotHtml()
236+
private WriterScope NonHtmlScope()
240237
=> new(this, isWritingHtml: false);
238+
239+
private WriterScope HtmlScope()
240+
=> new(this, isWritingHtml: true);
241241
private void WriteHtmlToken(SyntaxToken token)
242242
{
243243
var content = token.Content;

0 commit comments

Comments
 (0)