On Sun, Jun 28, 2020 at 8:49 PM Félix <[email protected]> wrote:
*Here I will lay out a couple of basic principles that I now apply when > working on this project. I have gathered them in the last year while trying > to get Leo and vscode's APIs to behave nicely with each other. (They are > NOT applicable on other programming projects that do not consist of > bridging two different, unknown APIs.)* > Many thanks for these remarks. They are helpful and insightful. This is not 'fun' programming with nice algorithms being created, and the > like. It's a work of binding "this to that" from an api to the other. There > will be plenty of time to do 'fun' programming with it after it's done. > I agree completely. Leo's flexx and console guis are examples of this kind of work. I never got to what I would consider 100% usability, partly because of the limitations of browsers (for flexx) and npyscreen (for the console gui). Nobody knows better than I the immense amount of work required to do a complete gui. The LSP protocol <https://microsoft.github.io/language-server-protocol/specifications/specification-current/> is another example of the work involved in bridging api's. This page <https://code.visualstudio.com/api/language-extensions/language-server-extension-guide> gives a fairly detailed ts example. I thought maybe a server written in python would be simpler. Googling found this page <https://github.com/palantir/python-language-server>. The code is difficult, even in python. Each time I have endeavored into making leointeg do more than Leo, I > regretted it > Yes, there will be plenty of time for improvements later. There is a larger design issue, one that has no obvious right answer: what exactly are Leo's essential features in the context of vs-code? I woke up with this question before reading your post. In particular, what are Leo's essential settings when using vs-code? Clearly, many settings in leoSettings.leo become moot. But which ones? For example, Leo has lots of colorizer settings, but imo it would be more natural to use vs-code's settings for each language. Eventually, leoInteg might open, say, vscodeSettings.leo instead of leoSettings.leo. One could even imagine specifying *existing* vs-code settings using vscodeSettings.leo. But that's for much later, or never. Still, representing settings as an outline is a perfectly reasonable thing to do. > After the 3rd or 4th time that my ideas of grandeur simply made the > project get delayed by months at a time, I now make sure I implement any > general Leo feature into vscode in the most simple, easy, basic way > possible that just reflects what Leo does in appearance. > This is a wise choice. leoInteg is a huge project as it is. Lastly, if a feature is accidentally made better, I leave it at that > obviously. For example, in Leo the coloring is applied correctly when > selecting a node. (changing coloring triggers by typing while staying in > the same node may not apply coloring correctly, but re-selecting a node > fixes it.) In vscode, the rules are reapplied at any keypress perfectly, or > so it seems, so that's a happy accident that's totally acceptable, and in > fact appreciated greatly. > I'm glad you mentioned this. My present plan for syntax coloring is to create a "leo" LSP server. This will be the "mother of all servers": it will delegate all syntax coloring (except Leonine constructs) to the "real" colorer for the @language in effect at the cursor. As I said in another post, this will use leoInteg's json description of Leonine constructs, but much more work is required. On every keystroke the "leo" server will have to compute (the possibly cached) value of the language to use, then redispatch the request to the proper LSP. It won't be fun, as the code I mentioned earlier shows. ... if that makes any sense. > It makes perfect sense. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAMF8tS3s4UEzmYxCgH9cJWmJdX6gPz-5v%3DWpsfkYTzPsh8WWgg%40mail.gmail.com.
