leoInteg and recent files

46 views
Skip to first unread message

Edward K. Ream

unread,
Jul 14, 2020, 9:47:52 AM7/14/20
to leo-e...@googlegroups.com
At present, the only way to add a .leo file to the Open Recent menu is to open the file without using leoInteg. Alas, the running leoInteg has no access to the Open Recent menu. I have to give the full path to ekr-leoInteg.leo every. single. time.

While researching this topic, I ran across vs code issue 64223: Extension API access to recent files/projects. This topic has been closed:

    "we are closing issues that are not going to be addressed in the foreseeable future."

I think we should push back. I am wondering whether the vs code devs would be interested in a PR. I think this is a significant hole in the api that should be plugged.

Without access to recent files, leoInteg looks like it would have to create its own "Recent Leo Files" menu item, along with the necessary machinery to make it work. Possibly a setting would work, to be updated when opening a .leo file.

Félix, these are my first thoughts. What do you think?

Edward

Félix

unread,
Jul 14, 2020, 7:21:22 PM7/14/20
to leo-editor
Greetings, Earth Leonistas!

Thank you for bringing up this issue Edward,

I've created issue #72 to tackle this & moved it on top of the todo pile: https://github.com/boltex/leointeg/projects/1

So far I've gathered concepts to implement Leo "opening recent / context menu / re-open from last session" functionality in that issue. Please feel free to add (or copy) propositions in there too.

The first brick wall to circumvent That I foresee is the fact that vscode, itself, will always consider a .leo file a normal xml file, because well, that's what it is! So for vscode, the vanilla 'open file' concept will always be "open it as xml text in an editor". (Actually, I hope I'm wrong and that I can just plug my OpenLeoFile to replace the 'openFile' for .leo files! I'l revise the docs later to be sure.)

But - nothing prevents us to define an 'openLeoFile command, taking a string parameter (path+filename string) and assing this to a "right-click" context menu item to normal explorer files. (which is easy to do.) That openLeoFile(p_fileName) commandcan be reused as-is to open files that were opened when vscode was closed, etc... 

So much more things are possible, when trying to integrate opening '.leo' files integration and automation, in regards to the action of actually opening a leo file with leoInteg instead of opening as an xml text file.

Which brings me to another subject: I've got to finish a part of the body pane filesystem provider that I forgot to even list in the issues : I've got to 'clear' the recent files of the body's gnx fake filenames. Thing is: Leo files will never be in your recent files list: they're not opened by vscode! :) the body gnx's are! 

(unless you've accidentally clicked on a leo file, and stared at the xml for a second thinking "duh that's not what I want"! hehe, then it will be in your recent documents menu list.)

Another idea, is that leoInteg can easily manage its own internal list of recent files and propose a one-click list "dropdown" solution on top of the other Ideas listed above.

so in conclusion there's many options to help and provide the user with the concept of opening files at startup, offereing 'recent Leo files' list to instantly open files with a mouse click, etc.

And I want to gather more ideas and note them in the issue (#72) to contemplate them a little while, distill the best of it, and only then, implement the best ones.
--
Félix

Félix

unread,
Jul 15, 2020, 1:07:56 AM7/15/20
to leo-editor
good news, i worked on it a bit and i was too pessimistic. not finished yet though..

Félix

Edward K. Ream

unread,
Jul 15, 2020, 6:45:40 AM7/15/20
to leo-editor
On Tue, Jul 14, 2020 at 6:21 PM Félix <felix...@gmail.com> wrote:

> Thank you for bringing up this issue Edward,

You're welcome. I'm glad you're making progress on it.

> ...vscode, itself, will always consider a .leo file a normal xml file, because well, that's what it is! So for vscode, the vanilla 'open file' concept will always be "open it as xml text in an editor". (Actually, I hope I'm wrong and that I can just plug my OpenLeoFile to replace the 'openFile' for .leo files! I'l revise the docs later to be sure.)

This was the motivation for my suggestion to allow programmatic access to vs code's notion of a recent file.

> nothing prevents us to define an 'openLeoFile command, taking a string parameter (path+filename string) and assiging this to a "right-click" context menu item to normal explorer files. (which is easy to do.) That openLeoFile(p_fileName) command can be reused as-is to open files that were opened when vscode was closed, etc...

Sounds like a good plan.

The svg preview plugin shows that opening and rendering can be done automatically when selecting a file in the explorer. leoInteg doesn't have to go this far :-)

So much more things are possible, when trying to integrate opening '.leo' files integration and automation, in regards to the action of actually opening a leo file with leoInteg instead of opening as an xml text file.

Good to hear.

> ...in conclusion there's many options to help and provide the user with the concept of opening files at startup, offering 'recent Leo files' list to instantly open files with a mouse click, etc.

Thanks for the discussion. There seems to be no urgent need to ask the vs code devs for an enhancement to the vs code api.

Edward
Reply all
Reply to author
Forward
0 new messages