boltex/leointeg

Leo Integration Settings: hangs on "Saving..." when entering "Python Command"

Closed this issue · 4 comments

maphew commented
  1. After entering a value for "Python Command" the Leo Integration Settings window in vscode pops up a button with the text "Saving..." that never goes away. I waited for 10 minutes or so.

The value I tried entering:

C:\Users\Matt\.local\pipx\venvs\leo\Scripts\python C:\Users\Matt\.local\pipx\venvs\leo\Lib\site-packages\leo\core\leoserver.py

  1. On closing vscode and restarting, and then opening the settings window again, the Python Command field was blank. I tried adding the same value, again the forever "Saving..." popup.

  2. On the 3rd close and restart of vscode the Leo Integrations Settings window opened completely empty, and the error

Error loading webview: Error: Could not register service worker: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..

  1. On the 4th close and restart of vscode the Leo Integ settings window opened normally and had same values as in step 1; "Leo-Editor Path" is defined and "Python Command" is empty.

  2. I repeated step 1, and got same frozen saving message.

  3. Close and restart, no problem opening settings window. Entered C:\Users\Matt\.local\pipx\venvs\leo\Scripts\python for Python Command --> frozen saving.

  4. Error loading webview again. I tried closing the vscode panel window instead of exiting application, and reopening Leo Integ settings again, but got repeat webview error.

  5. Exit and restart vscode >> settings window opened ok >> entered C:\Users\Matt\.local\pipx\venvs\leo\Scripts\python.exe --> stalled again. This time I noticed that the 'Saving...' message pops up before the text field loses focus. I realized I've been pasting the various paths in up to now.

  6. Exit and restart vsode code >> settings webview error >> exist and restart vscode >> settings okay >> Type in the "Python Command" field: the Saving popup occurs as soon as a single character is entered .

I encountered this problem while working through #291 and #10.

image

boltex commented

@maphew Thanks for finding this bug!

I probably broke that field in the latest updates I made to the leointeg settings while fixing something else :)

I'll fix this tonight and I'll release a new LeoInteg version making sure this works.

In the meantime, those setting can be changed also very easily in vscode's regular settings page. (look for 'leointeg' expansion settings.)

maphew commented

In vscode's settings I see "Leo Python Command" setting, and put in the path to the venv python, C:\Users\Matt\.local\pipx\venvs\leo\Scripts\python.exe. However after that opening Leo Integration Settings does not show this path, the field is empty. On restarting vscode and opening Leo Integ Settings panel I get the webview error again.

image

image

boltex commented

@maphew Thanks again for this report. There was indeed a weird glitch that was introduced by accident for the python command field in the last update: I've patched and released LeoInteg 1.0.15 to address this issue. (please restart your vscode to make sure you've got this new LeoInteg version running)

The settings panel now also shows the command it will use to launch the server in a box below the leo path and python command fields of the server setings :)

Hope this helps resolving the launch of the leoserver on your machine!

Félix

maphew commented

fix confirmed, thanks!