Second round of comments re leointeg

91 views
Skip to first unread message

Edward K. Ream

unread,
Jun 13, 2020, 2:25:28 PM6/13/20
to leo-editor
I have spent several pleasant hours playing with leointeg. There are still problems.

The following are based on detailed notes I took as I worked:

1. The leointeg video was extremely valuable. I don't want to see screen shots in Leo issues, because I am so familiar with Leo. But here, in a completely new environment, seeing vs-code in action was exactly what a newbie such as myself needs.

Félix, would you be interested in creating a similar video for Leo itself? It would guide people to installing and running Leo the first time.

2. I wasted an hour or more not following the video's instructions. It's crucial to install the latest version of node.js, namely 12.18.0. I downloaded node.js from https://nodejs.org/en/download/.

It's probably also wise to update to the latest version of vs-code as well. I am running 1.46.0.

3. One thing not shown in the video. When installing node.js, do NOT install the optional tools! If you do, you will likely install python 3.8 in a most inconvenient manner. I eventually backed out of the 3.8 installation.

4. I did a fresh install of leointeg: git clone https://github.com/boltex/leointeg.git

5. On my machine, there is no way to open the leointeg folder using "Open with Code", probably because I didn't install vs-code additions to the file browser. No problem. I just used vs-code's "Open Folder" option.

6. From the terminal (in vs-code), I did npm install, as shown in the video. It worked as shown in the video.

BTW, the video doesn't make clear (to a newbie) how you opened the terminal. I opened the terminal from the Terminal menu.

7. As shown in the video, I clicked the "Run Extension" triangle. Very clear.

I assume F5 would have done the same thing, but it's easier to show clicks in a video.

Success! For the first time ever most everything works.  I see "Starting type checking service..."

In the debug console I see:

leoInteg upgraded from v0.1.9 to v0.1.10.
leoInteg startup launched
in 5 ms.

8. I now see two windows.

- It was helpful for the video to show the windows being resized. That resizing made clear that there are, in fact, two separate windows.

- I see the Leo Lion in one of the windows. Some debugging messages appear in the other window.

9. Starting the server from within vs-code fails:

Starting server with command : py -3 c:\leo-repo\leointeg\leobridgeserver.py
Websocket error: connect ECONREFUSED 127.0.0.1:32125

I suspect the problem is related to "py -3".

10. Starting the server in a separate console works:

> cd c:\leo-repo\leointeg
> python leobridgeserver.py

Now I see an "Open Leo File" button in vs-code!

11. Choosing LeoDocs.leo shows the outline.

I see this server message in the separate console window:

Leo file opened. Its outline contains 2579 nodes positions.
Testing app.test_round_trip_positions for all nodes: Total time: 0.047 sec.

12. Editing the outline fails. I see this in the separate console window:

Caught Websocket Disconnect Event
Stopping leobridge server

Summary

The video was incredibly helpful. It would be great if Leo had something similar.

Following the installation instructions is mandatory :-) Beware of installing separate node.js tools.

I was not able to start the server from within vs-code. I was able to install the server from a separate console.

I was able to load a .leo file. Changing the file disconnected vs-code from the server.

This is all great progress.  Many thanks, Félix, for the plugin and the video.

As I mentioned in another thread, it would be most helpful to know all possible details of what the server does and how it does it.

Edward

Félix

unread,
Jun 13, 2020, 4:14:28 PM6/13/20
to leo-editor
Thanks for that! 

Very much appreciated!!! 

I'm surprised by your point #12: 

> Editing the outline fails. I see this in the separate console window:

I modify both the outline and body contents, save , etc... without any problems. But I suspect it has something to do with the websockets because of your earlier message : Websocket error: connect ECONREFUSED 127.0.0.1:32125 although you stated that you thought it may have been related to the launching of python with 'py -3'... I'll have to investigate.

i'll reboot into my windows partition to try 'exactly' what you did : I'm going to open the same LEO file with leointeg... maybe there was something in it that makes the JSON crash... (how could that be?) What version of leo were you using? (I'm gonna 'git pull' in leo's folder to get your latest version... havent done that in a while.)

Also, what do you mean by 'modifying the outline?' did you try something simple such as 'ctrl+u' to move a node up? or via the command palette (ctrl+shift+p)? or an icon on a node when you mouse-hover on it? 

Please take a look at the test sheet I did https://docs.google.com/spreadsheets/d/1M7TA3J0hkBpU4BkyChThrhzwKxhTPtQHacXDYRvEQes/edit?usp=sharing It states the various ways to interact with leo via leointeg and may be useful to more rapidly "pin-point" any problems.

I'll report with more details as soon as I try this out. Please dont hesitate to report back with more details too at your leisure :)

Félix

Félix

unread,
Jun 13, 2020, 4:33:18 PM6/13/20
to leo-editor
Also, may I suggest, since you start the server with 'python' instead of "py -3" to change that launch command in leoInteg's setting webview,. (as shown in the readme) so that you could now start it automatically from leoInteg.

Félix

unread,
Jun 13, 2020, 6:48:47 PM6/13/20
to leo-e...@googlegroups.com
Ok, so I tried some stuff and rapidly found a way to reproduce the problem (use Leo 6.2) and an easy workaround (Use Leo 6.1 final with git checkout b80e074204f359e159f992f5fc80a9043c63f614 ) 

Optionally, I would also suggest to you,  in order to have the latest bug fixes, switch leointeg to the 'dev' branch (click on 'master' on the extreme lower left corner in vscode) so you'l also have the fixes from the 'Done in dev' column shown here : https://github.com/boltex/leointeg/projects/1 I'll make sure to develop new styuff in sub branches and keep the dev (and moreso master) branch "stable with finished features".

eh! Now I guess I'll see what I need to change in leoInteg to make it work in 6.2 ! Silly me should have kept my Leo Up to date to catch this one earlier !!  lol

& Any insights are welcome :) 

Félix

edit : Heres the function that changes the body of a node. if you spot something unsupported as of 6.2 I'D like to know :)
edit again: looks like the dirtyVnodeList parameter is unsuported / unnedded now
Last Edit : OK I fixed it and pushed it to 'dev' branch going to push to master very soon  (couple of minutes)

def setBody(self, p_package):
'''Change Body text of a node'''
for w_p in self.commander.all_positions():
if w_p.v.gnx == p_package['gnx']: # found
b = self.commander.undoer.beforeChangeNodeContents(w_p, oldYScroll=0) # setup undoable operation
w_p.v.setBodyString(p_package['body'])
self.commander.undoer.afterChangeNodeContents(w_p, command="set-body", bunch=b, dirtyVnodeList=[w_p.v])
if not w_p.v.isDirty():
w_p.setDirty()
break
return self.sendLeoBridgePackage() # Just send empty as 'ok'

Edward K. Ream

unread,
Jun 14, 2020, 6:16:59 AM6/14/20
to leo-editor
On Sat, Jun 13, 2020 at 5:48 PM Félix <felix...@gmail.com> wrote:

 I guess I'll see what I need to change in leoInteg to make it work in 6.2 ! Silly me should have kept my Leo Up to date to catch this one earlier !!  lol

Right :-)

Edward

Edward K. Ream

unread,
Jun 14, 2020, 6:49:56 AM6/14/20
to leo-editor
On Sunday, June 14, 2020 at 5:16:59 AM UTC-5, Edward K. Ream wrote:
On Sat, Jun 13, 2020 at 5:48 PM Félix wrote:

 I guess I'll see what I need to change in leoInteg to make it work in 6.2 ! Silly me should have kept my Leo Up to date to catch this one earlier !!  lol

Right :-)

Please make sure leointeg works with the present "devel" branch. That's the ever-changing target for development.

leoBridge.py has changed since Leo 6.2 final. gitk leoBridge.py will give the full details.  For example:

5adef9: Simplify leoBridge.py per #1472
915d63: Fix crasher by defining g.app.global_cacher
a4733b: Completed #1350 & tweaked g.toUnicode, g.Tracing/NullObject
d8826e: Don't even think about using the qt gui in the bridge

etc.!

Edward

Edward K. Ream

unread,
Jun 14, 2020, 7:13:55 AM6/14/20
to leo-editor
On Sat, Jun 13, 2020 at 3:33 PM Félix <felix...@gmail.com> wrote:
Also, may I suggest, since you start the server with 'python' instead of "py -3" to change that launch command in leoInteg's setting webview,. (as shown in the readme) so that you could now start it automatically from leoInteg.

Thanks. That worked.

In more detail, I changed the "Python Command" option (in the leoBridge section) to "python". It was empty previously.

Edward

Félix

unread,
Jun 14, 2020, 2:39:08 PM6/14/20
to leo-e...@googlegroups.com
Thanks! 

All right : so Leo's 'devel' branch is the equivalent of my 'dev' branch... ! :) I'll keep my local Leo in its latest 'devel' branch to test everything from now on. 

Also I hope you have pulled the body edition bug fix I did last night and saw that complete outline and body edition is now implemented (with more obscure functions still lacking as per the list in the readme)

About hte 'leobridge' options of leointeg: Yes the leoInteg 'welcome and settings' screen has all the leoInteg options in one easy-to-find place :) 

Leaving empty gave you the 'default' launch command for windows : "Py" as shown in the helper text below that field. See the screenshot below with the red arrow. 


(Currently making some quick syntax coloring tests) - Ill posts some other youtube movies soon!

Félix
Message has been deleted

Edward K. Ream

unread,
Jun 15, 2020, 7:59:44 AM6/15/20
to leo-editor
On Sun, Jun 14, 2020 at 1:39 PM Félix <felix...@gmail.com> wrote:

> I hope you have pulled the body edition bug fix I did last night and saw that complete outline and body edition is now implemented (with more obscure functions still lacking as per the list in the readme)

The latest rev, 5971f426, appears to work well. I can save changes to the body.

Edward

Edward K. Ream

unread,
Jun 15, 2020, 8:09:32 AM6/15/20
to leo-editor
On Sun, Jun 14, 2020 at 10:46 PM Félix <felix...@gmail.com> wrote:

Getting the basic "general" Leo color syntaxing was not that hard once I finally understood the 'textMate' standard for specifying tokenization rules!

Excellent!

live on branch #37 as of now, and soon to be on the dev and master branch in a couple of hours. :) 

Here are some links that I have bookmarked:

- leointeg main github page
- leointeg issues
- leointeg PR's, for example, #37 & #54.
- leointeg theory post

I am starting to understand how all the pieces fit together. I'll present my own summary in another post for your comments and corrections.

Edward

Félix

unread,
Jun 15, 2020, 5:39:29 PM6/15/20
to leo-editor
I feel a bit stupid for this but I cannot seem to be able to switch to the 'devel' branch as much as I try... I only see master, head, and branches with names for Leo's releases (6.1, 5.4, etc.. ) (I'm not an expert at all with GIT) 

Here is my console with stuff I tried: 

If I use the UI for git related stuff in vscode I see this : 


Or is it this one? 



Anyways thanks in advance for any pointers ... I thought it would be a 5 second thing like "git checkout devel" but I've been checking for all sorts of ways in google on how to 'switch to a remote branch from github" online for a few hours now... lol  So I going to stay on Leo's master branch 6.2.x for now hehe.. 

Félix 

Félix

unread,
Jun 15, 2020, 6:49:41 PM6/15/20
to leo-e...@googlegroups.com
Turns out all the problems were because of the shallow clone that I got originally when first getting the repo months (or years) ago. This seems to prevent seeing all branches and whatnot.

I deleted everything , and found a solution at http://leoeditor.com/installing.html#installing-leo-from-sources-all-platforms with git clone --single-branch -b devel --depth=200 https://github.com/leo-editor/leo-editor.git

This gave me a new repo that is on the 'devel' branch! (this inverted the problem : its the only branch it seems to be aware of when i do "git branch -r" )

I still dont know how to how to switch from/to remote branches from the Leo main repo but at least I've got a way to get either branch individually ! :)

(This stackoverflow solution seemed to be a good way to get all branches:  https://stackoverflow.com/questions/12762922/git-cannot-see-new-remote-branch but it started a MASSIVE download that I killed with ctrl+break and restarted all with the solution above in bold...)

This adventure in trying to switch to the devel branch of leo really got me aware of how little i really know what I'm doing with git! 
--
Félix

EDIT - FOUND BEST SOLUTION: Adds a remote branch to a shallow cloned repository ! Hurray! : git remote set-branches origin 'devel' 

Félix

unread,
Jun 15, 2020, 11:20:06 PM6/15/20
to leo-editor
no need to bookmark issues and or pull requests with this link : https://github.com/boltex/leointeg/projects/1

Those are the issues, with the benefit of seeing their importance and priority. 

Edward K. Ream

unread,
Jun 16, 2020, 6:24:01 AM6/16/20
to leo-editor
On Mon, Jun 15, 2020 at 10:20 PM Félix <felix...@gmail.com> wrote:
no need to bookmark issues and or pull requests with this link : https://github.com/boltex/leointeg/projects/1

Those are the issues, with the benefit of seeing their importance and priority. 

Thanks. I've bookmarked it.

Edward

Edward K. Ream

unread,
Jun 16, 2020, 6:25:37 AM6/16/20
to leo-editor
On Mon, Jun 15, 2020 at 5:49 PM Félix <felix...@gmail.com> wrote:

I still dont know how to how to switch from/to remote branches from the Leo main repo but at least I've got a way to get either branch individually ! :)

Try git fetch.

Edward

Félix

unread,
Jun 16, 2020, 2:34:02 PM6/16/20
to leo-editor
Was the first thing I tried. Seems like it fetches other branches but onlt if they were created after the point of shalowness. 

Solution was git remote set-branches origin 'devel'  which explicitly gets the branch definition regardless of point of creation/ origin.

Shallow clones were something a bit new for me! :)
--
Félix 

Matt Wilkie

unread,
Jun 17, 2020, 2:41:56 AM6/17/20
to leo-editor
I deleted everything , and found a solution at http://leoeditor.com/installing.html#installing-leo-from-sources-all-platforms with git clone --single-branch -b devel --depth=200 https://github.com/leo-editor/leo-editor.git

This gave me a new repo that is on the 'devel' branch! (this inverted the problem : its the only branch it seems to be aware of when i do "git branch -r" )


That should be "git clone --no-single-branch ..." to avoid the problem. And, the instructions on that page are my doing. I'll update shortly.

 
EDIT - FOUND BEST SOLUTION: Adds a remote branch to a shallow cloned repository ! Hurray! : git remote set-branches origin 'devel' 

Excellent, and, FYI, you can use ` git remote set-branches origin '*' ` to enable all branches on a single-branch clone.

Git is really amazing, I love what it does for us. I rather resent all the arcana I've been forced to learn though!

-matt



Reply all
Reply to author
Forward
0 new messages