You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've developed a prompt that performs spellchecking by integrating the pyspellcheck library. However, I've noticed that underlining misspelled words causes a significant lag. I've optimized the spell-checking process by using caches, but the lag persists.
Upon further investigation, I added a print statement to the apply_transformation function and found that it is being called four times per keystroke. I attempted to create a ConditionalProcessor to address this, but there is no key_inserted event. Instead, I implemented hashing the buffer's text, but this approach breaks the underlining functionality entirely.
Any advice on how to resolve this issue would be greatly appreciated.
I tried creating an async Filter, this didn't work:
venv/lib/python3.12/site-packages/prompt_toolkit/completion/base.py:346: RuntimeWarning: coroutine 'AsyncSleepFilter.__call__' was never awaited
if self.filter():
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
I hit the missing async pre-processor thing too when wanting to implement a hover for a language server integration in my code. @jonathanslenders An async Processor would be handy. Until then, running the spell checker asynchronous and calling in from a non async code is a viable solution. asyncer can handle this easily by automatically running the async code on another thread.
Hi,
I've developed a prompt that performs spellchecking by integrating the pyspellcheck library. However, I've noticed that underlining misspelled words causes a significant lag. I've optimized the spell-checking process by using caches, but the lag persists.
Upon further investigation, I added a print statement to the
apply_transformation
function and found that it is being called four times per keystroke. I attempted to create aConditionalProcessor
to address this, but there is nokey_inserted
event. Instead, I implemented hashing the buffer's text, but this approach breaks the underlining functionality entirely.Any advice on how to resolve this issue would be greatly appreciated.
Thank you!
Sample: https://gist.github.com/planetis-m/ad078e0e184439e2712f3b853c192d01
The text was updated successfully, but these errors were encountered: