Skip to content

Conversation

ToddGrun
Copy link
Contributor

@ToddGrun ToddGrun commented Aug 9, 2024

I've noticed debugging locally that for every keystroke I'm seeing two StringTexts created that span the entire buffer. The creation of these texts originates from ParsedSyntaxTree needing to create SourceText, and the only way it knowing to do so is by serializing the tree into a string and creating a StringText from it.

I feel like DocumentState.TryReuseSiblingRoot should be able to utilize the sibling's sourcetext in addition to it's tree, but I'm not 100% positive.

…nal SourceText.

I've noticed debugging locally that for every keystroke I'm seeing two StringTexts created that span the entire buffer. The creation of these texts originates from ParsedSyntaxTree needing to create SourceText, and the only way it knowing to do so is by serializing the tree into a string and creating a StringText from it.

I *feel* like DocumentState.TryReuseSiblingRoot should be able to utilize the sibling's sourcetext in addition to it's tree, but I'm not 100% positive.
@ToddGrun ToddGrun requested a review from CyrusNajmabadi August 9, 2024 22:53
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 9, 2024
@ToddGrun ToddGrun changed the title Modity ISyntaxTreeFactoryService.CreateSyntaxTree to take in an optional SourceText. Modify ISyntaxTreeFactoryService.CreateSyntaxTree to take in an optional SourceText. Aug 9, 2024
@ToddGrun
Copy link
Contributor Author

ToddGrun commented Aug 10, 2024

Passed ci, my limited testing, and a test insertion, so elevating out of draft status. @CyrusNajmabadi -- how will this break things?

@ToddGrun ToddGrun marked this pull request as ready for review August 10, 2024 00:29
@ToddGrun ToddGrun requested a review from a team as a code owner August 10, 2024 00:29
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.

3 participants