137 references to UnsafeKeyword
Microsoft.CodeAnalysis.CSharp (16)
Binder\Binder_Flags.cs (1)
96
return (this.Flags.Includes(BinderFlags.UnsafeRegion) || !modifiers.Any(SyntaxKind.
UnsafeKeyword
))
Parser\LanguageParser.cs (11)
352
case SyntaxKind.
UnsafeKeyword
:
797
var unsafeToken = this.TryEatToken(SyntaxKind.
UnsafeKeyword
);
1050
case SyntaxKind.
UnsafeKeyword
:
2020
case SyntaxKind.
UnsafeKeyword
:
2189
case SyntaxKind.
UnsafeKeyword
:
7417
case SyntaxKind.
UnsafeKeyword
:
8223
case SyntaxKind.
UnsafeKeyword
:
9224
Debug.Assert(this.CurrentToken.Kind == SyntaxKind.
UnsafeKeyword
);
9227
this.EatToken(SyntaxKind.
UnsafeKeyword
),
9733
case SyntaxKind.
UnsafeKeyword
:
9801
case SyntaxKind.
UnsafeKeyword
:
Symbols\Source\ModifierUtils.cs (2)
311
return SyntaxFacts.GetText(SyntaxKind.
UnsafeKeyword
);
361
case SyntaxKind.
UnsafeKeyword
:
Syntax\SyntaxKindFacts.cs (2)
979
return SyntaxKind.
UnsafeKeyword
;
1619
case SyntaxKind.
UnsafeKeyword
:
Microsoft.CodeAnalysis.CSharp.CodeStyle (4)
CSharpAccessibilityFacts.cs (1)
139
SyntaxKind.
UnsafeKeyword
=> DeclarationModifiers.Unsafe,
CSharpIdeCodeStyleOptions.cs (1)
26
SyntaxKind.
UnsafeKeyword
,
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
48
case SyntaxKind.
UnsafeKeyword
:
SyntaxNodeExtensions.cs (1)
400
m => m.GetModifiers().Any(SyntaxKind.
UnsafeKeyword
));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (13)
ConstructorGenerator.cs (1)
131
tokens.Add(SyntaxFactory.Token(SyntaxKind.
UnsafeKeyword
));
EventGenerator.cs (1)
239
tokens.Add(SyntaxFactory.Token(SyntaxKind.
UnsafeKeyword
));
FieldGenerator.cs (1)
149
tokens.Add(SyntaxFactory.Token(SyntaxKind.
UnsafeKeyword
));
ITypeSymbolExtensions.cs (1)
100
if (reference.GetSyntax().ChildTokens().Any(t => t.IsKind(SyntaxKind.
UnsafeKeyword
)))
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (2)
503
targetToken.GetAncestors<MemberDeclarationSyntax>().Any(m => m.GetModifiers().Any(SyntaxKind.
UnsafeKeyword
) ||
504
targetToken.GetAncestors<LocalFunctionStatementSyntax>().Any(f => f.GetModifiers().Any(SyntaxKind.
UnsafeKeyword
)));
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
25
SyntaxKind.
UnsafeKeyword
,
MethodGenerator.cs (2)
264
tokens.Add(SyntaxFactory.Token(SyntaxKind.
UnsafeKeyword
));
315
tokens.Add(SyntaxFactory.Token(SyntaxKind.
UnsafeKeyword
));
PropertyGenerator.cs (1)
399
tokens.Add(SyntaxFactory.Token(SyntaxKind.
UnsafeKeyword
));
SyntaxKindSet.cs (3)
25
SyntaxKind.
UnsafeKeyword
,
45
SyntaxKind.
UnsafeKeyword
,
60
SyntaxKind.
UnsafeKeyword
,
Microsoft.CodeAnalysis.CSharp.Features (50)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
574
case SyntaxKind.
UnsafeKeyword
:
Completion\CompletionProviders\OverrideCompletionProvider.cs (1)
139
case SyntaxKind.
UnsafeKeyword
:
Completion\KeywordRecommenders\AbstractKeywordRecommender.cs (3)
21
SyntaxKind.
UnsafeKeyword
,
33
SyntaxKind.
UnsafeKeyword
,
44
SyntaxKind.
UnsafeKeyword
,
Completion\KeywordRecommenders\AsyncKeywordRecommender.cs (1)
23
SyntaxKind.
UnsafeKeyword
Completion\KeywordRecommenders\ClassKeywordRecommender.cs (1)
24
SyntaxKind.
UnsafeKeyword
,
Completion\KeywordRecommenders\DelegateKeywordRecommender.cs (1)
21
SyntaxKind.
UnsafeKeyword
Completion\KeywordRecommenders\EventKeywordRecommender.cs (1)
28
SyntaxKind.
UnsafeKeyword
Completion\KeywordRecommenders\ExplicitKeywordRecommender.cs (2)
19
SyntaxKind.
UnsafeKeyword
,
27
SyntaxKind.
UnsafeKeyword
,
Completion\KeywordRecommenders\ExternKeywordRecommender.cs (3)
25
SyntaxKind.
UnsafeKeyword
,
36
SyntaxKind.
UnsafeKeyword
,
42
SyntaxKind.
UnsafeKeyword
Completion\KeywordRecommenders\FixedKeywordRecommender.cs (1)
21
SyntaxKind.
UnsafeKeyword
,
Completion\KeywordRecommenders\ImplicitKeywordRecommender.cs (2)
19
SyntaxKind.
UnsafeKeyword
,
27
SyntaxKind.
UnsafeKeyword
,
Completion\KeywordRecommenders\InterfaceKeywordRecommender.cs (1)
20
SyntaxKind.
UnsafeKeyword
Completion\KeywordRecommenders\NewKeywordRecommender.cs (2)
29
SyntaxKind.
UnsafeKeyword
,
43
SyntaxKind.
UnsafeKeyword
Completion\KeywordRecommenders\OverrideKeywordRecommender.cs (1)
21
SyntaxKind.
UnsafeKeyword
,
Completion\KeywordRecommenders\RecordKeywordRecommender.cs (1)
24
SyntaxKind.
UnsafeKeyword
,
Completion\KeywordRecommenders\RefKeywordRecommender.cs (3)
37
SyntaxKind.
UnsafeKeyword
,
56
SyntaxKind.
UnsafeKeyword
,
74
SyntaxKind.
UnsafeKeyword
,
Completion\KeywordRecommenders\SealedKeywordRecommender.cs (3)
22
SyntaxKind.
UnsafeKeyword
,
34
SyntaxKind.
UnsafeKeyword
,
44
SyntaxKind.
UnsafeKeyword
,
Completion\KeywordRecommenders\StaticKeywordRecommender.cs (5)
21
SyntaxKind.
UnsafeKeyword
,
35
SyntaxKind.
UnsafeKeyword
,
51
SyntaxKind.
UnsafeKeyword
,
64
SyntaxKind.
UnsafeKeyword
,
72
SyntaxKind.
UnsafeKeyword
Completion\KeywordRecommenders\StructKeywordRecommender.cs (1)
20
SyntaxKind.
UnsafeKeyword
,
Completion\KeywordRecommenders\UnsafeKeywordRecommender.cs (1)
64
: base(SyntaxKind.
UnsafeKeyword
)
Completion\KeywordRecommenders\VirtualKeywordRecommender.cs (2)
22
SyntaxKind.
UnsafeKeyword
,
34
SyntaxKind.
UnsafeKeyword
,
Completion\KeywordRecommenders\VoidKeywordRecommender.cs (1)
28
SyntaxKind.
UnsafeKeyword
,
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
198
modifiers: TokenList(otherMethod.Modifiers.Where(m => m.Kind() is SyntaxKind.AsyncKeyword or SyntaxKind.
UnsafeKeyword
)),
ExtractMethod\CSharpSelectionResult.cs (1)
186
.Any(m => m.GetModifiers().Any(SyntaxKind.
UnsafeKeyword
)))
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (3)
135
if (setMethodDeclaration?.Modifiers.Any(SyntaxKind.
UnsafeKeyword
) == true
136
&& !property.Modifiers.Any(SyntaxKind.
UnsafeKeyword
))
138
property = property.AddModifiers(SyntaxFactory.Token(SyntaxKind.
UnsafeKeyword
));
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (6)
129
if (propertyDeclaration.Modifiers.Any(SyntaxKind.
UnsafeKeyword
)
130
&& !methodDeclaration.Modifiers.Any(SyntaxKind.
UnsafeKeyword
))
132
methodDeclaration = methodDeclaration.AddModifiers(SyntaxFactory.Token(SyntaxKind.
UnsafeKeyword
));
184
if (propertyDeclaration.Modifiers.Any(SyntaxKind.
UnsafeKeyword
)
185
&& !methodDeclaration.Modifiers.Any(SyntaxKind.
UnsafeKeyword
))
187
methodDeclaration = methodDeclaration.AddModifiers(SyntaxFactory.Token(SyntaxKind.
UnsafeKeyword
));
Snippets\AbstractCSharpTypeSnippetProvider.cs (1)
36
SyntaxKind.
UnsafeKeyword
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (33)
Generated\Syntax.Test.xml.Generated.cs (4)
404
=> InternalSyntaxFactory.UnsafeStatement(new Microsoft.CodeAnalysis.Syntax.InternalSyntax.SyntaxList<Syntax.InternalSyntax.AttributeListSyntax>(), InternalSyntaxFactory.Token(SyntaxKind.
UnsafeKeyword
), GenerateBlock());
2323
Assert.Equal(SyntaxKind.
UnsafeKeyword
, node.UnsafeKeyword.Kind);
10380
=> SyntaxFactory.UnsafeStatement(new SyntaxList<AttributeListSyntax>(), SyntaxFactory.Token(SyntaxKind.
UnsafeKeyword
), GenerateBlock());
12299
Assert.Equal(SyntaxKind.
UnsafeKeyword
, node.UnsafeKeyword.Kind());
Parsing\FileModifierParsingTests.cs (2)
1597
N(SyntaxKind.
UnsafeKeyword
);
1861
N(SyntaxKind.
UnsafeKeyword
);
Parsing\ScriptParsingTests.cs (5)
968
NewModifier_WithOtherModifier("unsafe", SyntaxKind.
UnsafeKeyword
);
1212
N(SyntaxKind.
UnsafeKeyword
);
1234
N(SyntaxKind.
UnsafeKeyword
);
1262
N(SyntaxKind.
UnsafeKeyword
);
1293
N(SyntaxKind.
UnsafeKeyword
);
Parsing\StatementAttributeParsingTests.cs (3)
1591
N(SyntaxKind.
UnsafeKeyword
);
1947
N(SyntaxKind.
UnsafeKeyword
);
2020
N(SyntaxKind.
UnsafeKeyword
);
Parsing\StatementParsingTests.cs (1)
1463
Assert.Equal(SyntaxKind.
UnsafeKeyword
, us.UnsafeKeyword.Kind());
Parsing\UsingDirectiveParsingTests.cs (16)
682
N(SyntaxKind.
UnsafeKeyword
);
794
N(SyntaxKind.
UnsafeKeyword
);
854
N(SyntaxKind.
UnsafeKeyword
);
886
N(SyntaxKind.
UnsafeKeyword
);
1171
N(SyntaxKind.
UnsafeKeyword
);
1219
N(SyntaxKind.
UnsafeKeyword
);
1291
N(SyntaxKind.
UnsafeKeyword
);
1321
N(SyntaxKind.
UnsafeKeyword
);
1396
N(SyntaxKind.
UnsafeKeyword
);
1442
N(SyntaxKind.
UnsafeKeyword
);
1526
N(SyntaxKind.
UnsafeKeyword
);
1556
N(SyntaxKind.
UnsafeKeyword
);
2156
N(SyntaxKind.
UnsafeKeyword
);
2230
N(SyntaxKind.
UnsafeKeyword
);
2256
N(SyntaxKind.
UnsafeKeyword
);
2333
N(SyntaxKind.
UnsafeKeyword
);
Syntax\SyntaxNodeTests.cs (2)
3432
var newModifiers = method.Modifiers.Add(SyntaxFactory.Token(default(SyntaxTriviaList), SyntaxKind.
UnsafeKeyword
, SyntaxFactory.TriviaList(SyntaxFactory.Space)));
3436
Assert.Equal(SyntaxKind.
UnsafeKeyword
, newModifiers[1].Kind());
Microsoft.CodeAnalysis.CSharp.Workspaces (18)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
1721
list.Add(SyntaxFactory.Token(SyntaxKind.
UnsafeKeyword
));
ConstructorGenerator.cs (1)
131
tokens.Add(SyntaxFactory.Token(SyntaxKind.
UnsafeKeyword
));
CSharpAccessibilityFacts.cs (1)
139
SyntaxKind.
UnsafeKeyword
=> DeclarationModifiers.Unsafe,
CSharpIdeCodeStyleOptions.cs (1)
26
SyntaxKind.
UnsafeKeyword
,
EventGenerator.cs (1)
239
tokens.Add(SyntaxFactory.Token(SyntaxKind.
UnsafeKeyword
));
FieldGenerator.cs (1)
149
tokens.Add(SyntaxFactory.Token(SyntaxKind.
UnsafeKeyword
));
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs\SyntaxNodeExtensions.cs (1)
400
m => m.GetModifiers().Any(SyntaxKind.
UnsafeKeyword
));
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
48
case SyntaxKind.
UnsafeKeyword
:
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (2)
503
targetToken.GetAncestors<MemberDeclarationSyntax>().Any(m => m.GetModifiers().Any(SyntaxKind.
UnsafeKeyword
) ||
504
targetToken.GetAncestors<LocalFunctionStatementSyntax>().Any(f => f.GetModifiers().Any(SyntaxKind.
UnsafeKeyword
)));
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
25
SyntaxKind.
UnsafeKeyword
,
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (1)
100
if (reference.GetSyntax().ChildTokens().Any(t => t.IsKind(SyntaxKind.
UnsafeKeyword
)))
MethodGenerator.cs (2)
264
tokens.Add(SyntaxFactory.Token(SyntaxKind.
UnsafeKeyword
));
315
tokens.Add(SyntaxFactory.Token(SyntaxKind.
UnsafeKeyword
));
PropertyGenerator.cs (1)
399
tokens.Add(SyntaxFactory.Token(SyntaxKind.
UnsafeKeyword
));
SyntaxKindSet.cs (3)
25
SyntaxKind.
UnsafeKeyword
,
45
SyntaxKind.
UnsafeKeyword
,
60
SyntaxKind.
UnsafeKeyword
,
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
CodeGeneration\CodeGenerationTests.cs (1)
790
yield return CS.SyntaxFactory.Token(CS.SyntaxKind.
UnsafeKeyword
);
Microsoft.VisualStudio.LanguageServices.CSharp (2)
CodeModel\ModifierFlagsExtensions.cs (2)
34
{ ModifierFlags.Unsafe, SyntaxKind.
UnsafeKeyword
},
89
case SyntaxKind.
UnsafeKeyword
: