TypeStrong / atom-typescript

The only TypeScript package you will ever need
https://atom.io/packages/atom-typescript
MIT License
1.13k stars 204 forks source link

Semantics view large file optimizations #1570

Closed aminya closed 3 years ago

aminya commented 3 years ago

I have done some optimizations to prevent freezes when the outline is going to be shown for a large file.

Since semantics-view is similar, I think the same optimizations should be used.

https://github.com/atom-community/atom-ide-outline/blob/a1ec8adf5399df4fc0caecdef85ec399e4ec6343/src/main.ts#L51

P.S: I will extend the API of the outline, so you can just make the semantics-view through the outline API.

aminya commented 3 years ago

I removed the code that added a listener for cursor changes. This is a very heavy computation that blocks the main thread, and it really slows down the editor in large files. I completely removed the listener, and instead, I added a command (Reveal Cursor), which the users can call or click by a button to find the symbol of the cursor.

I recommend the same thing for SemanticsView. The following that you see completely freezes the editor during typing in the large files.

Screenshot 2021-02-27 175110

As an alternative, I really recommend merging these two together. If there is any functionality that you need, I will add it to the outline. There should not be two similar competing features