115 references to ThisKeyword
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
376loggerParam = parameterSyntax.WithModifiers(SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.ThisKeyword)));
Microsoft.CodeAnalysis.CSharp (34)
Binder\Binder_Expressions.cs (1)
9807var name = candidate.IsIndexer ? SyntaxFacts.GetText(SyntaxKind.ThisKeyword) : candidate.Name;
Declarations\DeclarationTreeBuilder.cs (1)
1068if (modifier.Kind == SyntaxKind.ThisKeyword)
Parser\DocumentationCommentParser.cs (2)
942case SyntaxKind.ThisKeyword: 971Debug.Assert(CurrentToken.Kind == SyntaxKind.ThisKeyword);
Parser\LanguageParser.cs (15)
1679case SyntaxKind.ThisKeyword: 3007if (identifierOrThisOpt.Kind == SyntaxKind.ThisKeyword) 3336if (this.CurrentToken.Kind is SyntaxKind.BaseKeyword or SyntaxKind.ThisKeyword) 3342token = this.EatToken(SyntaxKind.ThisKeyword, ErrorCode.ERR_ThisOrBaseExpected); 3968Debug.Assert(thisKeyword.Kind == SyntaxKind.ThisKeyword); 4738case SyntaxKind.ThisKeyword: 4855Debug.Assert(identifierOrThisOpt.Kind == SyntaxKind.ThisKeyword); 6333case SyntaxKind.ThisKeyword: 6464if (this.CurrentToken.Kind == SyntaxKind.ThisKeyword) 6716if (this.PeekToken(1).Kind == SyntaxKind.ThisKeyword) 8391if (identifierOrThisOpt.Kind == SyntaxKind.ThisKeyword) 8645case SyntaxKind.ThisKeyword: 10630case SyntaxKind.ThisKeyword: 10922case SyntaxKind.ThisKeyword: 11535case SyntaxKind.ThisKeyword:
SymbolDisplay\SymbolDisplayVisitor.Members.cs (2)
210AddKeyword(SyntaxKind.ThisKeyword); 1004AddKeyword(SyntaxKind.ThisKeyword);
Symbols\Source\LocalFunctionSymbol.cs (1)
323firstParam.Modifiers.Any(SyntaxKind.ThisKeyword);
Symbols\Source\ParameterHelpers.cs (5)
441case SyntaxKind.ThisKeyword: 506addERR_BadParameterModifiers(diagnostics, modifier, SyntaxKind.ThisKeyword); 663if (thisKeyword.Kind() == SyntaxKind.ThisKeyword && parameterIndex != 0) 758else if (thisKeyword.Kind() == SyntaxKind.ThisKeyword) 958case SyntaxKind.ThisKeyword:
Symbols\Source\SourceMemberContainerSymbol.cs (1)
2268diagnostics.Add(ErrorCode.ERR_MemberAlreadyExists, indexer.GetFirstLocation(), SyntaxFacts.GetText(SyntaxKind.ThisKeyword), this);
Symbols\Source\SourceOrdinaryMethodSymbol.cs (2)
102firstParam.Modifiers.Any(SyntaxKind.ThisKeyword), 248var thisKeyword = syntax.ParameterList.Parameters[0].Modifiers.FirstOrDefault(SyntaxKind.ThisKeyword);
Syntax\SyntaxKindFacts.cs (3)
598case SyntaxKind.ThisKeyword: 985return SyntaxKind.ThisKeyword; 1633case SyntaxKind.ThisKeyword:
Syntax\SyntaxNormalizer.cs (1)
975case SyntaxKind.ThisKeyword:
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
89public static readonly SyntaxToken ThisKeyword = Token(SyntaxKind.ThisKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (2)
312previousToken.Kind() == SyntaxKind.ThisKeyword) 334previousToken.Kind() == SyntaxKind.ThisKeyword ||
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1107if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.ReadOnlyKeyword or SyntaxKind.OutKeyword or SyntaxKind.ThisKeyword or SyntaxKind.ParamsKeyword or SyntaxKind.ScopedKeyword)
Microsoft.CodeAnalysis.CSharp.Features (4)
Completion\KeywordRecommenders\InKeywordRecommender.cs (1)
44if (previousModifier == SyntaxKind.ThisKeyword &&
Completion\KeywordRecommenders\RefKeywordRecommender.cs (1)
131if (previousModifier == SyntaxKind.ThisKeyword &&
Completion\KeywordRecommenders\ThisKeywordRecommender.cs (1)
16: base(SyntaxKind.ThisKeyword)
Completion\Providers\ContextVariableArgumentProvider.cs (1)
26protected override string ThisOrMeKeyword => SyntaxFacts.GetText(SyntaxKind.ThisKeyword);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Compilation\SemanticModelGetSemanticInfoTests.cs (1)
15053var expr = (ExpressionSyntax)tree.FindNodeOrTokenByKind(SyntaxKind.ThisKeyword).Parent;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (62)
Generated\Syntax.Test.xml.Generated.cs (12)
116=> InternalSyntaxFactory.ThisExpression(InternalSyntaxFactory.Token(SyntaxKind.ThisKeyword)); 590=> InternalSyntaxFactory.IndexerDeclaration(new Microsoft.CodeAnalysis.Syntax.InternalSyntax.SyntaxList<Syntax.InternalSyntax.AttributeListSyntax>(), new Microsoft.CodeAnalysis.Syntax.InternalSyntax.SyntaxList<Syntax.InternalSyntax.SyntaxToken>(), GenerateIdentifierName(), null, InternalSyntaxFactory.Token(SyntaxKind.ThisKeyword), GenerateBracketedParameterList(), null, null, null); 629=> InternalSyntaxFactory.IndexerMemberCref(InternalSyntaxFactory.Token(SyntaxKind.ThisKeyword), null); 1140Assert.Equal(SyntaxKind.ThisKeyword, node.Token.Kind); 3203Assert.Equal(SyntaxKind.ThisKeyword, node.ThisKeyword.Kind); 3360Assert.Equal(SyntaxKind.ThisKeyword, node.ThisKeyword.Kind); 10332=> SyntaxFactory.ThisExpression(SyntaxFactory.Token(SyntaxKind.ThisKeyword)); 10806=> SyntaxFactory.IndexerDeclaration(new SyntaxList<AttributeListSyntax>(), new SyntaxTokenList(), GenerateIdentifierName(), default(ExplicitInterfaceSpecifierSyntax), SyntaxFactory.Token(SyntaxKind.ThisKeyword), GenerateBracketedParameterList(), default(AccessorListSyntax), default(ArrowExpressionClauseSyntax), default(SyntaxToken)); 10845=> SyntaxFactory.IndexerMemberCref(SyntaxFactory.Token(SyntaxKind.ThisKeyword), default(CrefBracketedParameterListSyntax)); 11356Assert.Equal(SyntaxKind.ThisKeyword, node.Token.Kind()); 13419Assert.Equal(SyntaxKind.ThisKeyword, node.ThisKeyword.Kind()); 13576Assert.Equal(SyntaxKind.ThisKeyword, node.ThisKeyword.Kind());
LexicalAndXml\CrefLexerTests.cs (1)
369Token(SyntaxKind.ThisKeyword),
Parsing\AsyncParsingTests.cs (3)
2046N(SyntaxKind.ThisKeyword); 2499N(SyntaxKind.ThisKeyword); 2548N(SyntaxKind.ThisKeyword);
Parsing\AsyncStreamsParsingTests.cs (3)
88N(SyntaxKind.ThisKeyword); 154N(SyntaxKind.ThisKeyword); 247N(SyntaxKind.ThisKeyword);
Parsing\AwaitParsingTests.cs (3)
498N(SyntaxKind.ThisKeyword); 1217N(SyntaxKind.ThisKeyword); 1967N(SyntaxKind.ThisKeyword);
Parsing\CrefParsingTests.cs (4)
258N(SyntaxKind.ThisKeyword); 269N(SyntaxKind.ThisKeyword); 303N(SyntaxKind.ThisKeyword); 322N(SyntaxKind.ThisKeyword);
Parsing\DeclarationParsingTests.cs (2)
3156TestClassMethodWithParameterModifier(SyntaxKind.ThisKeyword); 6309N(SyntaxKind.ThisKeyword);
Parsing\ExpressionParsingTests.cs (1)
501TestInstanceExpression(SyntaxKind.ThisKeyword);
Parsing\FieldKeywordParsingTests.cs (6)
350N(SyntaxKind.ThisKeyword); 407N(SyntaxKind.ThisKeyword); 473N(SyntaxKind.ThisKeyword); 545N(SyntaxKind.ThisKeyword); 789N(SyntaxKind.ThisKeyword); 2349N(SyntaxKind.ThisKeyword);
Parsing\FunctionPointerTests.cs (2)
3324N(SyntaxKind.ThisKeyword); 3329N(SyntaxKind.ThisKeyword);
Parsing\MemberDeclarationParsingTests.cs (4)
11787N(SyntaxKind.ThisKeyword); 18754N(SyntaxKind.ThisKeyword); 18836N(SyntaxKind.ThisKeyword); 18932N(SyntaxKind.ThisKeyword);
Parsing\PatternParsingTests.cs (1)
11891N(SyntaxKind.ThisKeyword);
Parsing\RefReadonlyTests.cs (3)
787N(SyntaxKind.ThisKeyword); 832N(SyntaxKind.ThisKeyword); 877N(SyntaxKind.ThisKeyword);
Parsing\ScriptParsingTests.cs (14)
818N(SyntaxKind.ThisKeyword); 874N(SyntaxKind.ThisKeyword); 923N(SyntaxKind.ThisKeyword); 1536N(SyntaxKind.ThisKeyword); 1577N(SyntaxKind.ThisKeyword); 1618N(SyntaxKind.ThisKeyword); 1665N(SyntaxKind.ThisKeyword); 4175N(SyntaxKind.ThisKeyword); 6844N(SyntaxKind.ThisKeyword); 6908N(SyntaxKind.ThisKeyword); 6978N(SyntaxKind.ThisKeyword); 7048N(SyntaxKind.ThisKeyword); 7116N(SyntaxKind.ThisKeyword); 7188N(SyntaxKind.ThisKeyword);
Parsing\StatementAttributeParsingTests.cs (1)
6705N(SyntaxKind.ThisKeyword);
Parsing\TopLevelStatementsParsingTests.cs (2)
48N(SyntaxKind.ThisKeyword); 1394N(SyntaxKind.ThisKeyword);
Microsoft.CodeAnalysis.CSharp.Workspaces (6)
Classification\ClassificationHelpers.cs (1)
332=> methodDeclaration.ParameterList.Parameters.FirstOrDefault()?.Modifiers.Any(SyntaxKind.ThisKeyword) == true;
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (1)
663=> method.ParameterList.Parameters is [var parameter, ..] && parameter.Modifiers.Any(SyntaxKind.ThisKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
89public static readonly SyntaxToken ThisKeyword = Token(SyntaxKind.ThisKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (2)
312previousToken.Kind() == SyntaxKind.ThisKeyword) 334previousToken.Kind() == SyntaxKind.ThisKeyword ||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1107if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.ReadOnlyKeyword or SyntaxKind.OutKeyword or SyntaxKind.ThisKeyword or SyntaxKind.ParamsKeyword or SyntaxKind.ScopedKeyword)
Microsoft.Interop.SourceGeneration (2)
Marshalling\MarshallerHelpers.cs (1)
447tokens = tokens.Add(Token(SyntaxKind.ThisKeyword));
TypePositionInfo.cs (1)
99IsExplicitThis = ((ParameterSyntax)paramSymbol.DeclaringSyntaxReferences[0].GetSyntax()).Modifiers.Any(SyntaxKind.ThisKeyword)
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\CSharpCodeModelService.cs (1)
3592return methodDeclaration.ParameterList.Parameters[0].Modifiers.Any(SyntaxKind.ThisKeyword);