Also note this small vscode bug that may affect the visuals while in development. https://github.com/microsoft/vscode/issues/118338
(minor and only while in development) On Tuesday, June 8, 2021 at 11:20:07 PM UTC-4 Félix wrote: > > Thanks tbp1!! Much appreciated!!! > > I'm french so I may have difficulty expressing myself properly, so bear > with me ;) > > I gather that I might not have explained properly what I mean by 3 ways to > start the server. ( i do *not* mean the 3 options in the debug dropdown! > Those '3' choices are just a confusing coincidence!) > > What I mean by that is that those 3 ways have *completely different > 'settings' applied *(such as what environment, what working dir path, > what string to start python with 'py', 'python' , 'python3', etc.) and may > not necessarily be setup in advance for your python and /or vscode > installations on your machine: > > *1-* (for experienced python programmers who want to debug the leoserver > live in vscode) Starting the server by/with vscode (choose "server and > extension" in the debug top dropdown.) means that python is setup and > started by vscode. As-if the leobridgeserver itself was the python project > that vscode tries to run and debug , So it will use the vscode settings for > running and debugging python that you have set in your vscode settings. > (not leointeg's settings) leointeg has no control, so this is for people > who have already setup their vscode to run/debug with python. > > *2-* another way, is in another external terminal like you did . > (settings are all controlled by what you type to start python and the > script - if it worked, take note of it and copy it in leointeg's settings > panel so it can start it itself with the proper command to start python on > your machine.) > > Screenshot below is vscode's run/debug choices. this is not 'leointeg's > options'.* Choose 'run extension' to have the real "1.0 user experience".* > [image: debug-menu.png] > > *3- *Third (*and best way*) is by having leointeg start the server > itself. so in the debug top dropdown choose "Run Extension" (then start > leointeg with F5, then in the new vscode window that opens i.e. the > 'extension host' goto the command palette and start typing 'leo welcome' to > access leointeg's settings page.) you can enter a specific string to start > python if the defaults don't work on your machine. (That's where noting > what worked by trying in an external terminal might come handy!) > > You don't have to necessarily have a server started beforehand. Leointeg > has buttons to start and connect to a server in it's outline pane while not > connected to a server. > > Please zoom in the parts noted in red to see what I mean. > [image: Screenshot from 2021-06-08 22-33-22.png] > > Leointeg has a special 'welcome/settings' screen where everything is > customizable and has somewhat helpful explanation text beneath each option. > > *Note: leointeg settings only exist/make sense in the extension host > window that was started with F5 while it's in development. **(So yes, > its kind of counter intuitive to have to start the extension before going > into its settings to, say, change the python command string for the server, > etc.) *Once released as a real extension the options and the settings > panel will exist all the time in vscode. > > Now, when leointeg tries to start the server, either automatically at > startup if you checked the 'start server' option, or, with the 'start > server' button in the leointegration panel, you will see what command > leointeg tried to use in the output pane below. (see text circled in red > below). > > [image: Screenshot from 2021-06-08 22-56-27.png] > thats it :) > > Also : *What do you mean: 'F5' on an @file? This does not make any sense > to me at all?!?* > > F5 is a vscode command to start running and debugging the main project in > it's workspace that the workspace is configured to do. So unless you have > cursor focus in an opened file, i.e. the actual file derived by the @file > node, not the body pane of the @file, ...and that vscode considers that > file in its workspace etc... then F5 will start it in the correct > interpreter/compiler that your vscode is configured to use for a given > language in a given workspace. > > So thanks a lot to tbp1 and to every one who would like to give this a > try! and don't hesitate to ask questions! > > *I realize now that the instructional video about how to run and start the > development version had no other choice than 'run extension' at the time. > since then I've added 'run server' and 'run both', which trips most people. > I should make it more explicit to choose 'run extension' in vscode's debug > view to have the final, true experience of a (soon to be released )1.0 > version.* > -- > Félix > > On Tuesday, June 8, 2021 at 9:18:13 PM UTC-4 [email protected] wrote: > >> On Tuesday, June 8, 2021 at 5:50:40 PM UTC-4 Félix wrote: >> >>> Hi all :) >>> >>> First - make sure you ran 'npm install' in leointeg's project folder to >>> fetch any new dependencies that may have been updated since last time. >>> >> >> I finally realized to do this, but it took some time. It brought in a >> lot of things. >> >>> >>> Second - (most important) specify how you want to start the server, >>> otherwise it's hard to help and give instructions :* There are 3 ways >>> to start the leobridgeserver while in developement* - (by vscode itself >>> to debug it while it runs, by leointeg itself using the command string in >>> its options settings, or starting it yourself in a terminal) after the >>> release, there will be only 2 ways (unless running in debug) >>> >> >> It's very hard to understand what the difference is. I tried the three >> ways offered in the "run" dropdown, but they always failed. >> >> >>> So to specify this, goto the debug view of vscode, (the triangle with >>> the bug) right at the top you have to choose what you want to debug (and >>> what will be started by vscode itself)* the extension, the server, or >>> both*. >>> >>> If you want vscode to start the server , (*like in Edwards original >>> post in this thread I presumed from his description*) then it's >>> vscode's own python development settings that will decide how it starts it. >>> (users using v1.0 will not be using this method) So leointeg has nothing to >>> do with it. >>> >>> If you choose to have leointeg start the server itself, choose "run >>> extension" only, in the top debug dropdown. (equivalent with the real >>> finished product,) then start with F5, then, in the extension host that >>> just popped and runs leointeg, open the leointeg settings panel and select >>> 'start server automatically', (and later come back here to also set the >>> python launch string if you need something other than 'python' on linux and >>> 'python3' on windows. (you may need to close the extension host and hit F5 >>> again to restart after setting the options if you want to actually see >>> leointeg start it by itself. ) >>> >> >> F5 did work to start the extension, as you said. The F5 that wouldn't >> work for me (mentioned in my last post) is in the extension window, where I >> wanted to run an @file program. However, I seem to like using the >> arrowhead-like icon in the lefthand icon panel. It's the fourth one down. >> That gives you the view where you can select to run the "extension only" up >> at the left top. >> >> >>> Another (third) way to start the server, is to simply start the >>> leobridgeserver.py script in a terminal program of your choice. >>> >> >> This is what worked for me. I started leobridgeserver outside of >> vscode. Then I used the little "run" button next to the dropdown where I >> had selected "run extension". Running the server from within vscode just >> hasn't worked for me. vsc runs my python batch file but the server >> apparently does not start. >> >> Oh, yes, this is on Windows 10. >> >> >>> To access leointeg's settings (while running leointeg in the extention >>> host) use ctrl+shift+P to open the command palette and start typing leo >>> settings (or leo welcome) to access the leointeg options. (to set your >>> python command line option for when you want leointeg to start the server >>> itself) >>> >>> I know it wont help you, hehe, but on both my windows and linux >>> machines, everything works without any special settings / string with my >>> vanilla installations of python. (I'm not a python expert who has many >>> pythons/anaconda/etc...) >>> >>> *Note: the leointeg welcome/settings webview are not visible in your >>> regular window of vscode, because it's generated by leointeg - so its only >>> available and visible in the extension host window that opens once you >>> press F5. * >>> -- >>> Félix >>> >>> -- 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/ff020583-9774-426a-8e40-1acdfb30387fn%40googlegroups.com.
