Proposal for collaborating on leoInteg

42 views
Skip to first unread message

Edward K. Ream

unread,
Jul 18, 2020, 11:02:13 AM7/18/20
to leo-editor
I propose that I do the python-related work, while you do the ts work. This should minimize code conflicts. It will also allow me to leverage my knowledge of Leo's base, as illustrated by the new version of bc.leoCommands, aka bc.outlineCommands.

It is also in the spirit of your request to suggest helper methods in leobridgeserver.py. However, there is at least one complication...

Defining commands for the Command palette

At present, package.json defines all Leo commands that are known to the vs code's command palette. This is static and clumsy.

To implement unimplemented commands I need to change package.json, which you plan to reorganize. Worse, there is no static list of Leo commands, because of @command and @button.

It would be great if some way could be found to make vs code's command palette aware of Leo's commands without have to specify each in package.json.  Yes, the "when" attribute is hand crafted now. However, I would be willing to add, for example, a "__when__" attribute in the methods that implements Leo's commands.

Félix, let me know what you think. For now I'll carry on hacking on package.json as needed, and we'll have to handle conflicts as usual.

Edward

Félix

unread,
Jul 18, 2020, 12:38:02 PM7/18/20
to leo-editor
Thats'great! 

On the branch I'm working on, I've already started the interface for the minibuffer and @commands usage : 

Alt+x Brings up a custom (fake) command pallette thats going to be acting mostly somewhat like the command pallette/Leo 's minibuffer. 

I switched working on something else because I lacked knowledge on the python's side of things to '"fetch all commands names" or "fetch all startin with string 'xxx'"... and "run-by-name"!

So as a starting (or branching) point : here's a throwaway leo file containing only a "basic" leoBridgeServer outline" just to show you the function skleletons: 

 - getCommand(optional starting string parameter in package) if empty string give all commands! (is that too much?)

 -  runByNAme(string parameter in package)

just checkout this attachments included in this post, grab those two skeletons (they're right under the getButtons/click@button stuff) and thrown the rest away its old stuff!


Gotta leave for an hour our two, I'll make sure to also pull the devel branch of Leo, like you mentioned earlier! 
:)

I'll hit you up later this afternoon! 
--
Félix
sample_getCommands_runByName.leo

Edward K. Ream

unread,
Jul 18, 2020, 1:18:33 PM7/18/20
to leo-editor
On Sat, Jul 18, 2020 at 11:38 AM Félix <felix...@gmail.com> wrote:

On the branch I'm working on, I've already started the interface for the minibuffer and @commands usage : 

Alt+x Brings up a custom (fake) command pallette thats going to be acting mostly somewhat like the command pallette/Leo 's minibuffer. 

I switched working on something else because I lacked knowledge on the python's side of things to '"fetch all commands names" or "fetch all startin with string 'xxx'"... and "run-by-name"!

Leo has several "master command" dicts that should help.

So as a starting (or branching) point : here's a throwaway leo file containing only a "basic" leoBridgeServer outline" just to show you the function skleletons: 

I see. After a .leo file loads, a single call so a similar function could return all the valid command names.

I wonder whether there is a way to give vc-code all of Leo's commands dynamically. Failing that, I wonder whether the startup code could create package.json dynamically.

Edward

Félix

unread,
Jul 18, 2020, 1:45:39 PM7/18/20
to leo-editor
If the list is long, maybe send all default leo base commands as a list to be kept, ensh leoBridge/leoInteg startup. 
... and only send back on calling get-commands (alt+x when opening the minibuffer-palette) the list of (added/removed might have changed) custom commands/@commands that may exist at that point in time. (as the whole of the default base Leo commands is a big list and does not change)

if it makes sense? (just got out of bed i'm fuzzy)
--
Félix

Edward K. Ream

unread,
Jul 18, 2020, 2:30:42 PM7/18/20
to leo-editor
On Sat, Jul 18, 2020 at 12:45 PM Félix <felix...@gmail.com> wrote:
If the list is long, maybe send all default leo base commands as a list to be kept, ensh leoBridge/leoInteg startup. 
... and only send back on calling get-commands (alt+x when opening the minibuffer-palette) the list of (added/removed might have changed) custom commands/@commands that may exist at that point in time. (as the whole of the default base Leo commands is a big list and does not change)

if it makes sense? (just got out of bed i'm fuzzy)

Could we talk on zoom about this. I'd like to throw out some ideas about the main function in leobridgeserver.py.

Edward

Edward K. Ream

unread,
Jul 18, 2020, 2:32:17 PM7/18/20
to leo-editor
On Sat, Jul 18, 2020 at 12:45 PM Félix <felix...@gmail.com> wrote:
If the list is long, maybe send all default leo base commands as a list to be kept, ensh leoBridge/leoInteg startup. 

Edward Ream is inviting you to a scheduled Zoom meeting.

Topic: Edward Ream's Personal Meeting Room

Join Zoom Meeting
https://us02web.zoom.us/j/4804959221

Meeting ID: 480 495 9221
One tap mobile
+13126266799,,4804959221# US (Chicago)
+19292056099,,4804959221# US (New York)

Dial by your location
        +1 312 626 6799 US (Chicago)
        +1 929 205 6099 US (New York)
        +1 301 715 8592 US (Germantown)
        +1 346 248 7799 US (Houston)
        +1 669 900 6833 US (San Jose)
        +1 253 215 8782 US (Tacoma)
Meeting ID: 480 495 9221
Find your local number: https://us02web.zoom.us/u/klFBHdYg8

Reply all
Reply to author
Forward
0 new messages