Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classify string fields with embedded languages if we can see their values passed to a StringSyntax api #77199

Merged
merged 3 commits into from
Feb 13, 2025

Conversation

CyrusNajmabadi
Copy link
Member

Fixes #77189

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner February 13, 2025 07:11
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 13, 2025

var block = tokenParent.AncestorsAndSelf().FirstOrDefault(blockFacts.IsExecutableBlock);
if (block is null)
return false;

var localName = localSymbol.Name;
if (localName == "")
return false;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pulled into pattern match above.

foreach (var descendent in statement.DescendantNodesAndSelf())
{
cancellationToken.ThrowIfCancellationRequested();
if (CheckDescendants(localSymbol, semanticModel, statement, cancellationToken, out identifier))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extracted into helper. we use it for the field case as well.

@@ -1312,4 +1312,70 @@ void Goo()
Namespace("RegularExpressions"),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

view with whitespace off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Could lang=regex syntax handling apply to consts that are later used in a recognized location?
3 participants