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

Optimize performance of text replacer context with autowrap and already formatted document #3120

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

mx990
Copy link
Contributor

@mx990 mx990 commented Aug 2, 2024

When calculating the leading chars in a line, the replacer context iterates over all previous contexts if there are no replacements. This PR also uses the region of the associated replacer to find the beginning of the current line.

Furthermore, it avoids unnecessary text replacer contexts by returning the current context when the resulting context would be identical.

Closes #3119

mx990 added 2 commits August 2, 2024 20:05
Avoid unnecessary text replacer contexts by returning the current
context when the resulting context would be identical.

Signed-off-by: Martin Jobst <[email protected]>
…xt#3119

When calculating the leading chars in a line, the replacer context
iterates over all previous contexts if there are no replacements. This
change also uses the region of the associated replacer to find the
beginning of the current line.

Signed-off-by: Martin Jobst <[email protected]>
@cdietrich cdietrich added this to the Release_2.36 milestone Aug 8, 2024
@cdietrich cdietrich merged commit 2bce8b6 into eclipse-xtext:main Aug 8, 2024
7 checks passed
@cdietrich
Copy link
Contributor

thx

@mx990 mx990 deleted the optimizeTextReplacerContext branch August 9, 2024 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[formatting2] Performance issues with autowrap and already formatted document
2 participants