Skip to content

Conversation

@CyrusNajmabadi
Copy link
Member

We're seeing traces where the allocations here show up. This would happen in files that have a massive amount of string literals in them. Mitigating cases where we could not need code folding here.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner June 9, 2023 20:16
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 9, 2023
if (node.IsKind(SyntaxKind.StringLiteralExpression) &&
!node.ContainsDiagnostics)
!node.ContainsDiagnostics &&
CouldBeMultiLine())
Copy link
Member Author

@CyrusNajmabadi CyrusNajmabadi Jun 9, 2023

Choose a reason for hiding this comment

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

we don't bother running on string literals we know to be single line.

namespace Microsoft.CodeAnalysis.Structure
{
internal sealed class BlockStructureContext
internal readonly ref struct BlockStructureContext
Copy link
Contributor

Choose a reason for hiding this comment

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

❗ Use a non-copyable non-ref struct

@CyrusNajmabadi CyrusNajmabadi requested a review from sharwell June 9, 2023 20:36
@CyrusNajmabadi CyrusNajmabadi merged commit 7a43937 into dotnet:main Jun 9, 2023
@CyrusNajmabadi CyrusNajmabadi deleted the stringFolding branch June 9, 2023 22:39
@ghost ghost added this to the Next milestone Jun 9, 2023
@RikkiGibson RikkiGibson modified the milestones: Next, 17.7 P3 Jun 28, 2023
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants