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

typescript--backward-to-parameter-list can cause multi-second delays in large files #185

Open
NateEag opened this issue Jun 1, 2023 · 4 comments

Comments

@NateEag
Copy link

NateEag commented Jun 1, 2023

I recently encountered a TypeScript file at $WORK that caused Emacs to freeze for multiple seconds after changing the buffer's contents.

I did a quick profile, and based on its results was able to get my Emacs instance back to usability by altering this line to set a limit for looking-back.

Could we introduce a limit here?

I don't know what a reasonable limit would be, nor why it's explicitly set to "no limit".

Note that there's another instance of that logic .

@NateEag
Copy link
Author

NateEag commented Jun 1, 2023

I blame-walked the history and found where the line was introduced, but I still don't understand why there's explicitly no limit to how far backwards we'll look.

@josteink
Copy link
Member

josteink commented Jun 2, 2023

If that's an option for you, I would recommend you get Emacs 29 (or build it from source), and use the new and shiny typescript-support added there.

https://github.com/emacs-typescript/typescript.el#good-news-though

It's much more accurate, faster and much less buggy 😄

@NateEag
Copy link
Author

NateEag commented Jun 2, 2023

Thanks for the suggestion, @josteink .

I've been eying the new tree-sitter support enviously, waiting for Emacs 29 to hit a proper release. Maybe I should roll up my sleeves and start building my own. 😃

@josteink
Copy link
Member

josteink commented Jun 2, 2023

There should be pre-release builds out there now I think, but maybe not yet for Windows?

CC: @phillord

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

No branches or pull requests

2 participants