Wow: more vs-code tips

80 views
Skip to first unread message

Edward K. Ream

unread,
Jun 26, 2020, 7:30:03 AM6/26/20
to leo-editor
I am presently watching this VS Code tips and tricks, by a vs-code dev. He has a YouTube tips channel.

This is truly great stuff. Some people complain that the videos are too long. On the contrary, I plan to spend considerable more time than the video's running time, trying out all the features. There are many hidden features that would be easy to miss in the blah, blah, blah of text. Anyway, seeing the features in action helps me learn them.

The first feature covered in this video is vs-code's timeline pane. Wow: this is history done right. Kent, take note. For leoInteg, I can instantly see the code changes corresponding to any of Félix's commits.

And that's just the first tip.

Edward

Edward K. Ream

unread,
Jun 26, 2020, 9:35:41 AM6/26/20
to leo-editor
On Friday, June 26, 2020 at 6:30:03 AM UTC-5, Edward K. Ream wrote:

I am presently watching this VS Code tips and tricks, by a vs-code dev. He has a YouTube tips channel.

Tip 3, goto symbol, is also great stuff.  It doesn't replace the need for organization, but it's a big help.  It would be great if leoInteg supported a "goto node" function. No rush, though :-)

I am starting to learn vs-code and electron. The docs are superb.

Félix, would you be interested in help with syntax coloring? It might be a good starter project for me.

Edward

Félix

unread,
Jun 26, 2020, 3:33:46 PM6/26/20
to leo-editor

Wow!! I would be delighted to have any help I can get with leoInteg! 

(later today/tonight I will merge the branch I'm on with 'dev' to give multiple opened files capabilities to the dev branch. making leoInteg somewhat "seriously usable" so please wait before I do that before branching off dev... just a suggestion... )

sidenote: I was wondering why you're talking about electron.... I just looked it up, I thought vscode was a fork of atom, ... turns out they're both forks of electron! 

About Syntax Coloring Strategy In LeoInteg: 

Indeed, syntax coloring is not that trivial as I originally thought so... First thing I will need do to continues improving the syntax-coloring is make sure a selected node not only receives it's body content, but also the language the node 'begins' in. (when @language set in a parent node) That will set the original language of the node, up to some possible @language elsewhere in the node. (applicable syntaxes definitions are then applied from one @language directive up until the next one is encountered)

As you can see in the 'dev' branch, a 'syntaxes' folder is now present to handle syntax coloring. 

In it, I have defined the "Leo Body" syntax, for body content not directly affected by an @language directive, given it the 'scopeName'  "source.leobody".
(see last line of leobody.tmLanguage.json in /sintaxes)

when a body pane 'Starts' in python by virtue of his parent's body being in python at the point of insertion of the @others, or because it starts with "@language python", it will be given the scope name 'token' "source.leoBodyPython". for which leobodyPython.tmLanguage.json in /sintaxes will have to be written.... and so on for each language suported by Leo.

I dont think we shoud re-use the already defined scope / tokens such as 'source.python' already defined and available in vscode, because we want to give the same highlights as in Leo, not vscode. (Remember the base philosophy of leoInteg: mimic and reproduce Leo, don't jump on what's available just because it is)

So please take the time to read and understand the contents of the /syntaxes folder, and also the syntax guide : https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide ... (or maybe you already understand all of this? ...I didnt get anything on my first read! but i'm a bit sleep-deprived lately)

Ok i'm not going to spend hours writing details about the syntax coloring I'v setup so far ... I'd better go finish the multi-file support for tonight and let you browse through what i've done so far in /syntaxes and wait for questions and remarks... 

So that's it for now I'll write some more details tonight or tomorrow morning :) thanks again and please don't hesitate to ask about anything or suggest better options!
--
Félix

Félix

unread,
Jun 27, 2020, 3:23:32 AM6/27/20
to leo-editor
going to bed ... its done but I'd like to test a bit more before pushing my changes ,. tomorrow it is then! :)

Edward K. Ream

unread,
Jun 27, 2020, 7:20:25 AM6/27/20
to leo-editor
On Fri, Jun 26, 2020 at 2:33 PM Félix <felix...@gmail.com> wrote:

Wow!! I would be delighted to have any help I can get with leoInteg! 

Glad it's ok with you. The more I study vs code, the more I think it is a great platform for hosting Leo's bridge.
 
...please wait before I do that before branching off dev...

Heh. I have lots of studying to do first.

Yesterday I spent over an hour getting typescript in 5 minutes to work, hehe. I made every conceivable mistake setting up .vscode/launch.json and test/ekr_ts_tests/tsconfig.json. It was all good. This is how I learn.

sidenote: I was wondering why you're talking about electron.... I just looked it up, I thought vscode was a fork of atom, ... turns out they're both forks of electron! 

I had forgotten that electron just draws web pages using chromium! This means that we get all the great w3c technologies and decades (centuries? millennia??) of rendering engineering. The architecture (master/renderer processes) seems like an excellent foundation.

I am also thinking that vs code will provide a more natural host for Joe Orr's great work.
About Syntax Coloring Strategy In LeoInteg: 

Indeed, syntax coloring is not that trivial as I originally thought so...

I am hoping that Leo's syntax can be an embedded language specified with a single embeddedLanguages contribution point. What do you think?  As you say, handling @others is going to take considerable work.

Edward

Félix

unread,
Jun 27, 2020, 7:11:10 PM6/27/20
to leo-editor
Had a migraine and spent all day in bed :( ... here are 2 thoughts i wanted to type under your last post before i jump back into bed:

So far no (js/ts) programming was involved in syntaxing : its all json textmate definitions.

Perhaps, a good part of it (switching from a language to another with @languages directives) using the 'embedded language' features you referred to, can also be done with json textmate definition file(s). 

I'll focus on more popular and pressing matters to make leoInteg "seriously useable" before going back to syntax coloring, but it's good to accumulate knowledge and comments about it, and not rush decisions of implementations too fast... :)

Félix

Edward K. Ream

unread,
Jun 28, 2020, 6:02:05 AM6/28/20
to leo-editor
On Sat, Jun 27, 2020 at 6:11 PM Félix <felix...@gmail.com> wrote:

Had a migraine and spent all day in bed :(

Get well soon!
So far no (js/ts) programming was involved in syntaxing : its all json textmate definitions.

I'll be writing an Engineering Notebook post on this topic when I know more.

Edward
Reply all
Reply to author
Forward
0 new messages