98 references to ThisKeyword
Microsoft.CodeAnalysis.CSharp (33)
Binder\Binder_Expressions.cs (1)
8445var name = candidate.IsIndexer ? SyntaxFacts.GetText(SyntaxKind.ThisKeyword) : candidate.Name;
Declarations\DeclarationTreeBuilder.cs (1)
917if (modifier.Kind == SyntaxKind.ThisKeyword)
Parser\DocumentationCommentParser.cs (2)
947case SyntaxKind.ThisKeyword: 976Debug.Assert(CurrentToken.Kind == SyntaxKind.ThisKeyword);
Parser\LanguageParser.cs (14)
1405case SyntaxKind.ThisKeyword: 2673if (identifierOrThisOpt.Kind == SyntaxKind.ThisKeyword) 3003if (this.CurrentToken.Kind is SyntaxKind.BaseKeyword or SyntaxKind.ThisKeyword) 3009token = this.EatToken(SyntaxKind.ThisKeyword, ErrorCode.ERR_ThisOrBaseExpected); 3605Debug.Assert(thisKeyword.Kind == SyntaxKind.ThisKeyword); 4422case SyntaxKind.ThisKeyword: 4551Debug.Assert(identifierOrThisOpt.Kind == SyntaxKind.ThisKeyword); 6023if (this.CurrentToken.Kind == SyntaxKind.ThisKeyword) 6290if (this.PeekToken(1).Kind == SyntaxKind.ThisKeyword) 7785if (identifierOrThisOpt.Kind == SyntaxKind.ThisKeyword) 8039case SyntaxKind.ThisKeyword: 9949case SyntaxKind.ThisKeyword: 10239case SyntaxKind.ThisKeyword: 10702case SyntaxKind.ThisKeyword:
SymbolDisplay\SymbolDisplayVisitor.Members.cs (2)
203AddKeyword(SyntaxKind.ThisKeyword); 1006AddKeyword(SyntaxKind.ThisKeyword);
Symbols\Source\LocalFunctionSymbol.cs (1)
290firstParam.Modifiers.Any(SyntaxKind.ThisKeyword);
Symbols\Source\ParameterHelpers.cs (5)
417case SyntaxKind.ThisKeyword: 482addERR_BadParameterModifiers(diagnostics, modifier, SyntaxKind.ThisKeyword); 626if (thisKeyword.Kind() == SyntaxKind.ThisKeyword && parameterIndex != 0) 731else if (thisKeyword.Kind() == SyntaxKind.ThisKeyword) 925case SyntaxKind.ThisKeyword:
Symbols\Source\SourceMemberContainerSymbol.cs (1)
2167diagnostics.Add(ErrorCode.ERR_MemberAlreadyExists, indexer.Locations[0], SyntaxFacts.GetText(SyntaxKind.ThisKeyword), this);
Symbols\Source\SourceOrdinaryMethodSymbol.cs (2)
87firstParam.Modifiers.Any(SyntaxKind.ThisKeyword), 260Location thisLocation = syntax.ParameterList.Parameters[0].Modifiers.FirstOrDefault(SyntaxKind.ThisKeyword).GetLocation();
Syntax\SyntaxKindFacts.cs (3)
570case SyntaxKind.ThisKeyword: 957return SyntaxKind.ThisKeyword; 1597case SyntaxKind.ThisKeyword:
Syntax\SyntaxNormalizer.cs (1)
975case SyntaxKind.ThisKeyword:
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
TokenBasedFormattingRule.cs (2)
306previousToken.Kind() == SyntaxKind.ThisKeyword) 328previousToken.Kind() == SyntaxKind.ThisKeyword ||
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
1091if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.OutKeyword or SyntaxKind.ThisKeyword or SyntaxKind.ParamsKeyword or SyntaxKind.ScopedKeyword)
ParameterGenerator.cs (1)
83list = list.Add(SyntaxFactory.Token(SyntaxKind.ThisKeyword));
Microsoft.CodeAnalysis.CSharp.Features (4)
Completion\KeywordRecommenders\InKeywordRecommender.cs (1)
44if (previousModifier == SyntaxKind.ThisKeyword &&
Completion\KeywordRecommenders\RefKeywordRecommender.cs (1)
101if (previousModifier == SyntaxKind.ThisKeyword &&
Completion\KeywordRecommenders\ThisKeywordRecommender.cs (1)
17: 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 (48)
Generated\Syntax.Test.xml.Generated.cs (12)
116=> InternalSyntaxFactory.ThisExpression(InternalSyntaxFactory.Token(SyntaxKind.ThisKeyword)); 572=> 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); 611=> InternalSyntaxFactory.IndexerMemberCref(InternalSyntaxFactory.Token(SyntaxKind.ThisKeyword), null); 1122Assert.Equal(SyntaxKind.ThisKeyword, node.Token.Kind); 3120Assert.Equal(SyntaxKind.ThisKeyword, node.ThisKeyword.Kind); 3277Assert.Equal(SyntaxKind.ThisKeyword, node.ThisKeyword.Kind); 10092=> SyntaxFactory.ThisExpression(SyntaxFactory.Token(SyntaxKind.ThisKeyword)); 10548=> SyntaxFactory.IndexerDeclaration(new SyntaxList<AttributeListSyntax>(), new SyntaxTokenList(), GenerateIdentifierName(), default(ExplicitInterfaceSpecifierSyntax), SyntaxFactory.Token(SyntaxKind.ThisKeyword), GenerateBracketedParameterList(), default(AccessorListSyntax), default(ArrowExpressionClauseSyntax), default(SyntaxToken)); 10587=> SyntaxFactory.IndexerMemberCref(SyntaxFactory.Token(SyntaxKind.ThisKeyword), default(CrefBracketedParameterListSyntax)); 11098Assert.Equal(SyntaxKind.ThisKeyword, node.Token.Kind()); 13096Assert.Equal(SyntaxKind.ThisKeyword, node.ThisKeyword.Kind()); 13253Assert.Equal(SyntaxKind.ThisKeyword, node.ThisKeyword.Kind());
LexicalAndXml\CrefLexerTests.cs (1)
369Token(SyntaxKind.ThisKeyword),
Parsing\AsyncParsingTests.cs (3)
2057N(SyntaxKind.ThisKeyword); 2510N(SyntaxKind.ThisKeyword); 2559N(SyntaxKind.ThisKeyword);
Parsing\AsyncStreamsParsingTests.cs (3)
88N(SyntaxKind.ThisKeyword); 154N(SyntaxKind.ThisKeyword); 247N(SyntaxKind.ThisKeyword);
Parsing\AwaitParsingTests.cs (2)
497N(SyntaxKind.ThisKeyword); 1274N(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\FunctionPointerTests.cs (2)
3324N(SyntaxKind.ThisKeyword); 3329N(SyntaxKind.ThisKeyword);
Parsing\PatternParsingTests.cs (1)
11930N(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)
6693N(SyntaxKind.ThisKeyword);
Parsing\TopLevelStatementsParsingTests.cs (2)
48N(SyntaxKind.ThisKeyword); 1394N(SyntaxKind.ThisKeyword);
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
Classification\ClassificationHelpers.cs (1)
334=> methodDeclaration.ParameterList.Parameters.FirstOrDefault()?.Modifiers.Any(SyntaxKind.ThisKeyword) == true;
CodeGeneration\CSharpSyntaxGenerator.cs (1)
198modifiers = modifiers.Insert(0, SyntaxFactory.Token(SyntaxKind.ThisKeyword));
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (1)
664=> method.ParameterList.Parameters is [var parameter, ..] && parameter.Modifiers.Any(SyntaxKind.ThisKeyword);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
1091if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.OutKeyword or SyntaxKind.ThisKeyword or SyntaxKind.ParamsKeyword or SyntaxKind.ScopedKeyword)
ParameterGenerator.cs (1)
83list = list.Add(SyntaxFactory.Token(SyntaxKind.ThisKeyword));
TokenBasedFormattingRule.cs (2)
306previousToken.Kind() == SyntaxKind.ThisKeyword) 328previousToken.Kind() == SyntaxKind.ThisKeyword ||
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\CSharpCodeModelService.cs (1)
3597return methodDeclaration.ParameterList.Parameters[0].Modifiers.Any(SyntaxKind.ThisKeyword);