Wow: top 10 vs-code pro tips

60 views
Skip to first unread message

Edward K. Ream

unread,
Jun 21, 2020, 9:54:26 AM6/21/20
to leo-e...@googlegroups.com
This 10-minute video is an excellent way to come up to speed with vs-code. It clearly shows why vs-code is so popular.

I have spent over an hour carefully working my way through the video, trying most of the examples and installing most of the plugins. Already I feel comfortable with vs-code.

Imo, it's impossible for Leo's devs to keep pace with vs-code. Supporting leoInteg seems like the way to keep Leo healthy and relevant.

Edward

P.S. Would it be worthwhile to rewrite the essentials of Leo's core in typescript? That way leoInteg would not need any client/server architecture.

The answer is "heck no!" leoInteg already has access to Leo's bridge. Rewriting the bridge in typescript would be a distraction, it would introduce many subtle bugs, and would have no obvious value.

P.P.S. Which Leo settings will remain important?

vs-code already has a more flexible key-binding scheme than Leo's. You can see this by looking at the "When" column in the "Keyboard Shortcuts" pane. This column contains (I think) an arbitrary expression. The binding is active only if that expression evaluates to true.

Many Leo's settings relate to editing functions that (in the vs-code world) are better handled using existing vs-code settings. Similarly, Leo settings relating to themes and other visual matters are not needed when using vs-code.

Leo settings relating to Leo-specific commands should remain. That includes Leo's abbreviations. That might be a big job, but I think it would be worth doing.

Edward

Félix

unread,
Jun 21, 2020, 12:52:20 PM6/21/20
to leo-editor
That's great news to wake up to!

about the p.p.s. of  leo's settings:

Worth noting that leoInteg checks with Leo's real settings that you might have set in Leo, for defaults regarding derived files, for example, So someone might use Leo, change those, and confidently switch back to using Leo via leoInteg, and those settings would apply.

It's somewhat important to specify the concept that leoInteg is not trying to hide or replace Leo by implementing it's functionality in js/ts... To the contrary: It's shamelessly openly exposed as a 'facade', and the real Leo is running behind. No wizard of 'Oz' here :)

Edward K. Ream

unread,
Jun 22, 2020, 5:12:33 PM6/22/20
to leo-editor
On Sun, Jun 21, 2020 at 11:52 AM Félix <felix...@gmail.com> wrote:

That's great news to wake up to!

Yeah, I'm pumped as well.  A few random thoughts:

- I had forgotten about #1025. You are quite right to say that leoInteg should support all (and only) Leo's essential features.

- I see that the command palette already supports some of Leo's outline-oriented (essential) commands. It might be good to use a separate Leo decorator to denote commands that leoInteg should support. But that's a nit.

- I also see that you support some Leo settings in the way cool settings pane.

- I just now realized what my "user error" was concerning F5. I have to remember to open the leoInteg folder if somehow it has been closed.

- I don't see syntax coloring in the Leo outlines.

- After F5, the new window contains an "Outline" area in the Explorer area. It says "The active editor can not provide outline information". What is the purpose of the "Outline" area?  There is also a "Timeline" area. It shows "No timeline information was provided". I wonder whether this might be related to a plugin, say gitLens.

It's somewhat important to specify the concept that leoInteg is not trying to hide or replace Leo by implementing it's functionality in js/ts... To the contrary: It's shamelessly openly exposed as a 'facade', and the real Leo is running behind. No wizard of 'Oz' here :)

I agree. This design is essential.

Edward

Félix

unread,
Jun 22, 2020, 7:27:38 PM6/22/20
to leo-editor

- I see that the command palette already supports some of Leo's outline-oriented (essential) commands. It might be good to use a separate Leo decorator to denote commands that leoInteg should support. But that's a nit.

They do have a decorator: "Leo", opening the command palette and ctrl+shit+P and typing 'leo' will restrict to leo commands. (you wont see them all because of space restriction but typing letters that are part of a command - i.e. "lazy typing matching like sublime"  ) 

But English is not my first language, and I feel I'm missing some meanings in your comments regarding this point. What do you mean by that exactly? 


- I also see that you support some Leo settings in the way cool settings pane.

In vscode, with the 'git-lens' extension installed, (i think it comes by default now even!.. not sure...)  open the command palette and start typing "git welcome" to see what inspired me for that settings "webview" page! 

- I don't see syntax coloring in the Leo outlines.

Wheuat?? what do you mean? syntax coloring works and it makes the whole 'leoInteg" landscape come together so nicely! I have to re-do all my gifs and movies because of that! Have you pulled 'dev' ? maybe I forgot to push ,,, I'll check again... 

maybe you meant that i had not finished language specific coloring (switching when encountering @language xxx until the next marker.) yes then you'Re right. but there is still parenthesis matching, etc.. and regular basic syntax coloring in leo bodies of @directives, code, comments, @, @c, etc..... but since I got a grasp of textmate syntax it does not worry me to finish this in a week or two...

... unless you meant literaly 'outline' syntax coloring? Is there color in the 'outline'? ... in Leo i dont see color in my outlines... hmm...

- After F5, the new window contains an "Outline" area in the Explorer area. It says "The active editor can not provide outline information". What is the purpose of the "Outline" area?  There is also a "Timeline" area. It shows "No timeline information was provided". I wonder whether this might be related to a plugin, say gitLens.

aha! - those are regular vscode views that are usually in the explorer panel indeed. they are standard, The 'outline' will show you a regular 'outline' of class methods, properties of a file that would be open in an editor. ...any file... just select a source in the explorer, it opens and boom, half a second later, a generated outline appears. its a plain representation of the source file. (the opposite of building with leo, if you will... or maybe like a plain 'import' tree without any structure depth to represent anything.)

I'm not explaining it very well, see this paragraph instead: https://code.visualstudio.com/docs/getstarted/userinterface#_outline-view  

Timeline is the timeline of, again, whatever file would be opened and focussed on.

Félix

Félix

unread,
Jun 22, 2020, 7:33:52 PM6/22/20
to leo-editor
About command palette entries: Command palette entries start at line 852 here, check it out, maybe it will clarify missing/present commands   https://github.com/boltex/leointeg/blob/boltex/issue47/package.json#L852

(i'll add more soon as per column "todo" in https://github.com/boltex/leointeg/projects/1 )

Félix

Félix

unread,
Jun 22, 2020, 8:43:37 PM6/22/20
to leo-editor

addendum : I just switched back to the dev branch: This is what the color syntaxing looks like : 
Examples under Themes: monokai, dark standard, solarized light, and default light

Edward K. Ream

unread,
Jun 23, 2020, 4:45:20 AM6/23/20
to leo-editor
On Mon, Jun 22, 2020 at 6:27 PM Félix <felix...@gmail.com> wrote:

- I see that the command palette already supports some of Leo's outline-oriented (essential) commands. It might be good to use a separate Leo decorator to denote commands that leoInteg should support. But that's a nit.

They do have a decorator: "Leo", opening the command palette and ctrl+shit+P and typing 'leo' will restrict to leo commands.

Thanks for the clarification. Do you have special code to discover Leo commands, or do you allow anything in c.commandDict?


- I also see that you support some Leo settings in the way cool settings pane.

In vscode, with the 'git-lens' extension installed, (i think it comes by default now even!.. not sure...) 

Iirc, a git extension is pre-installed. I installed git-lens manually.
 
open the command palette and start typing "git welcome" to see what inspired me for that settings "webview" page! 

That's cool. The description of git-lens in the plugins pane is even more impressive.
- I don't see syntax coloring in the Leo outlines.

Wheuat?? what do you mean? syntax coloring works and it makes the whole 'leoInteg" landscape come together so nicely! I have to re-do all my gifs and movies because of that! Have you pulled 'dev' ? maybe I forgot to push ,,, I'll check again... 

I just switched to your "dev" branch and did an npm install. Now I do see some syntax coloring in the body pane.

I see (both in my actual files and in your example gifs) that Leo's directives are colored, but not python-specific keywords such as "def".

Let's test for typescript. From the command palette I see that "Leo: Insert Node" is bound to  Ctrl + I. Very cool.

I created a new node, containing:

@language typescript

import * as vscode from "vscode";
import * as WebSocket from 'ws';
import { Constants } from "./constants";
import { LeoBridgePackage, LeoAction } from "./types";
import { LeoIntegration } from "./leoIntegration";
import { LeoAsync } from "./leoAsync";

Wow. Copy and paste from vs-code retains the styling in this email!

You see exactly what I see. The @language is not colored, nor are "import" and "as" and "from" keywords.

- After F5, the new window contains an "Outline" area in the Explorer area. It says "The active editor can not provide outline information". What is the purpose of the "Outline" area?  There is also a "Timeline" area. It shows "No timeline information was provided". I wonder whether this might be related to a plugin, say gitLens.

aha! - those are regular vscode views that are usually in the explorer panel indeed. they are standard, The 'outline' will show you a regular 'outline' of class methods, properties of a file that would be open in an editor. ...any file... just select a source in the explorer, it opens and boom, half a second later, a generated outline appears. its a plain representation of the source file. (the opposite of building with leo, if you will... or maybe like a plain 'import' tree without any structure depth to represent anything.)

I suspected as much. I think it would be fine to suppress those panes.

Edward

Edward K. Ream

unread,
Jun 23, 2020, 4:47:29 AM6/23/20
to leo-editor
On Mon, Jun 22, 2020 at 6:33 PM Félix <felix...@gmail.com> wrote:

About command palette entries: Command palette entries start at line 852 here, check it out, maybe it will clarify missing/present commands   https://github.com/boltex/leointeg/blob/boltex/issue47/package.json#L852

This answers my questions. Each entry refers to a Leo command and when that command should be active. This is the vs-code way, and it's much better than Leo's pane bindings. Your scheme is plenty good enough for now.

Edward

Edward K. Ream

unread,
Jun 23, 2020, 4:49:25 AM6/23/20
to leo-editor
On Mon, Jun 22, 2020 at 7:43 PM Félix <felix...@gmail.com> wrote:

addendum : I just switched back to the dev branch: This is what the color syntaxing looks like : 

This is congruent to what I am seeing. However, your examples do not show typescript or python keywords. Please show how this is colorized:

@language python
def spam():
    pass

Edward
Reply all
Reply to author
Forward
0 new messages