ChrisPenner / rasa

Extremely modular text editor built in Haskell
GNU General Public License v3.0
615 stars 42 forks source link

TODO #2

Open ChrisPenner opened 7 years ago

ChrisPenner commented 7 years ago
ChrisPenner commented 7 years ago

@Dtatoo Let me know when you have questions, I'm sure there'll be a few!

noughtmare commented 7 years ago

Switch to DYRE??

I recommend against doing this (at least in the current state of dyre). Yi does this, but it has been a source of many problems that newcomers have. I wrote a post about it here.

My main points are:

I think dyre is an awesome concept, but it still needs more development until its ready to use.

ChrisPenner commented 7 years ago

Those are some great points; thanks @noughtmare!

You're not the first to voice concerns about Dyre; and it definitely wasn't at the top of the priority list anyways. Looks like it's not a great idea, I'll remove it from the list!

I appreciate your feedback on this!

clojj commented 7 years ago

Hi,

Maybe for "Per Buffer event/hook system" or a separate TODO entry...

It would be nice to have some kind of BufferChanged event, indicating some deletion/insertion/.. in text-buffers. That could be beneficial to any kind of analysis/parsing/lexing extension.

I'd love to help out, if you can point me to the relevant places...

ChrisPenner commented 7 years ago

Hey there @clojj! That sounds like a good idea!

My plan is to limit the API for editing buffers to the operations available using this [range lens]. If you're willing to work on it that would be a great place to start!

Continue the discussion here: https://github.com/ChrisPenner/rasa/issues/20 I've added some bullet points that should help you get started! Post there if you have any questions, or drop into our Gitter chat

clojj commented 7 years ago

Great. btw. I am pondering what phase is best for colorizing/styling the buffer, after the lexer has tokenized.. ?

I would think that is beforeRender, or ?

ChrisPenner commented 7 years ago

beforeRender is correct yup 😁; it's after text-changes have occurred, but before they're rendered to the screen. You can see how the cursors extension renders the cursor here .

This uses elements from rasa-ext-style to signal to renderers how to display other ranges.

We'll likely have to make a few small changes to the way styles are rendered to allow optimizing performance for things like syntax highlighting; having a bufferChanged event is going to be useful for that 😁

clojj commented 7 years ago

So here is the basic setup of what I am trying to do... https://github.com/clojj/rasa/blob/master/rasa-example-config/app/Main.hs#L54

I'd like to setup the (Chan String, Chan [Located Token]) in onInit of course, but storing this in ext (btw, is Rasa.Internal.Editor.ext the editor-global state ? opposed to bufExt) is not easy.

As far as it goes, it is working.. I get all tokens inside the beforeRender handler (lexHaskell) Lots of todo's for sure :)

clojj commented 7 years ago

ok, easier than I thought https://github.com/clojj/rasa/blob/master/rasa-example-config/app/Main.hs#L84

newtypes galore !

ChrisPenner commented 7 years ago

Let's continue the discussion here: https://github.com/ChrisPenner/rasa/issues/24; Looks like you've done a lot of work on this! I'll definitely read it over this weekend!

jmatsushita commented 5 years ago

@ChrisPenner Here are some possible new action items to sort through after our gitter pow-wow.

In order to introduce widgets for autocomplete, file browsing and so on, there seems to be a need to extend the widget functionality to render them elsewhere than at the top/bottom/left/right of a View.

Seems that making the Widgets depend on a text position would allow to not leak the rendering abstractions. Does that work?

Also, work in progress on rasa-ext-syntax some questions come up about managing file types, language syntax, key maps per language and user configuration.

Should the BufTypeChanged type be introduced in Rasa.Internal.Events or in an extension? Should BufAdded be extended also to include the BufType in addition to the BufRef?

ChrisPenner commented 5 years ago

Great! I made issues for each of those and put them in a milestone 👍