-
Notifications
You must be signed in to change notification settings - Fork 42
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
Standardize Buffer text editing interface #20
Comments
dispatchEvent is type Action () |
Good catch; That's definitely on the list of things to fix! I'm in the process of revamping the Buffer referencing system right now so I'll put that at the top of my list; ideally all |
Great. |
Admittedly the It might eventually make sense to express styles generically as |
My Lexer runs in another thread. |
Check out All |
Thanks. So I will first try to tokenize synchronously. |
Yeah; that's a tricky thing; but of course any async task has to deal with the idea that things may have changed (otherwise it wouldn't be async 😝). Try getting it working synchronously; then we can experiment with different async versions. My personal recommendation would be to run it async; then in the returned |
basic setup for synchronous tokenization
introduce BufTextChanged event adresses issue ChrisPenner#20
Handled in #28 😄 |
We shouldn't allow extensions to just edit text however they like because it limits our knowledge of what extensions are doing. If we construct the api such that it uses a series of BufActions which we control; then we maintain flexibility in our implementation in the future.
This involves creating 3 new functions: (https://github.com/ChrisPenner/rasa/blob/master/rasa/src/Rasa/Internal/Editor.hs#L141); e.g. setRange, overRange, getRange; right now the range lens is exposed entirely; but that's going to make it tough to hook into in the future, so we should change it to a set of actions instead.
Here would be the rough steps involved:
range
lens with the appropriate new actionsBufTextChanged
or something like that; I'm thinking we should maybe include the range that was effected and the new text as part of the event? People can ignore it if they like.setRange, overRange
add adispatchEvent
for the newBufTextChanged
event AFTER editing the buffer text.As for making these events listenable on a 'per-buffer' basis, that's going to largely depend on this issue: #21
The text was updated successfully, but these errors were encountered: