-
Notifications
You must be signed in to change notification settings - Fork 43
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
Rewite indentation engine #53
Rewite indentation engine #53
Conversation
do you have any sense of what can be done about performance? I'd say a couple seconds for one file might be too slow. |
Two measures may improve the performance:
Caching syntactic informationWhen indenting a line, we analyze the text around the point. In most cases, analyzing a few lines is sufficient, but it may analyzes more lines in some cases. Caching analyzed information may improve the performance when indenting a bulk of lines. Actually, we analyze the position of brackets eagerly and cache them. Caching more information would complicate the code and might be slower for simple cases. Moving some code from lexer to indentation logicThe code is separated into two layers: the lexer and the indentation logic. The lexer is a pair of functions, |
Has development of this patch stopped? |
8f5e6f8
to
30a867d
Compare
@knobo |
4b32eb1
to
132e7c1
Compare
Add support for |
132e7c1
to
cc105de
Compare
cc105de
to
3dc0718
Compare
Rebased and fixed conflicts. |
Improve regression test to ignore known bug. Add pathological regression test.
3dc0718
to
063f26d
Compare
30510b2
to
70de256
Compare
Is there any possibility that this PR will be merged? |
New indentation engine, based on that of
swift-mode
.See
doc/indentation_logic/pages.pdf
for its design.Pros:
Cons:
indent-region
on entiresample.kt
takes a couple of secondsOptions: