Added grep / full-text search across decompiled source, along with text highlighting for the grep results#117
Added grep / full-text search across decompiled source, along with text highlighting for the grep results#11700x127 wants to merge 2 commits into
Conversation
|
Can you explain how it works? |
| onClick={() => handleResultClick(match.className)} | ||
| style={{ cursor: 'pointer', padding: '2px 8px', fontSize: '12px', borderRadius: '4px', transition: 'background-color 0.15s' }} | ||
| onMouseEnter={e => e.currentTarget.style.backgroundColor = 'rgba(255,255,255,0.1)'} | ||
| onMouseLeave={e => e.currentTarget.style.backgroundColor = 'transparent'} |
There was a problem hiding this comment.
Shouldn't this be done using a CSS hover selector instead?
There was a problem hiding this comment.
Nvm, this seems to just be a react thing. Weird framework :/
There was a problem hiding this comment.
I agree that using CSS would've been better.
| let scanned = 0; | ||
|
|
||
| for (let i = 0; i < classNames.length; i += SCAN_BATCH) { | ||
| if (cancelFlag) break; |
There was a problem hiding this comment.
Instead of having some global flag for cancellation, is there a way we could use something like AbortController?
It might also allow us to use Promise.all here too instead of a manual setTimeout
|
How's the performance? I've tried some JS libraries to do this, and they are quite slow. |
i've made it read raw bytes from each class file and scan the Java constant pool directly this is pure JS, takes ~1ms per class, and doesnt touch the decompile workers at all so in other words, its pretty fast |
|
Not fast enough to prevent my browser from freezing after it starts decompiling apparently. EDIT: Worked the second time? Also, seems like clicking on a match does take you to the right file, but not the right line. |
Hm, it does decompile the classes though? |
It only decompiles classes with matches, which is at least better than decompiling every class. |
odd, sticks around to 1ms for me |
|
Did you try with the IndexedDB cleared? Otherwise it will use the cached result. |
i did |
|
It might just be my system tbh, I'd say don't worry about too much unless others experience the same |
|
How come this hasn't been merged yet? |

No description provided.