Regarding js importing, after some research about the topic, I concluded it 
is not possible/practical to make perfect js importer that can fully import 
javascript code on its own. Doing it right would require building complete 
AI for this problem space and perhaps dealing with neural networks feeding 
them with big data collected from github and other source code repositories.

And even if we do make such a clever code and intelligent importer, 
javascript syntax is growing fast, and that would require enormous effort 
to keep up.

Instead, I believe, what would suffice (at least for my own needs) is bunch 
of new simple commands that can help human to orchestrate import process. 

Right now, I have other duties and can't dedicate enough time to realize 
this idea. In case someone else is willing to make it, I wouldn't mind.

*Blueprint for importing_tools plugin*

Make a bunch of command buttons (ideally with well designed icons) and 
place them in Log tab pane as a new pane. Every button should perform one 
of the following commands:

   - place-at-others-here
   
   places at-others directive before cursor. If cursor is indented then the 
   directive is indented by the same amount. If body already contains this 
   directive, command is noop
   - 
   
   extract-to-new-node 
   
   expects cursor to be placed after at-others line. Extracts all lines 
   from at-others to cursor in new node and starts editing headline. After 
   editing headline, returns focus to parent body.
   - 
   
   extract-to-previous-node
   extracts all lines from at-others line to cursor and append them to 
   the body of the last child node
   - 
   
   split-body
   splits body on the cursor position in two nodes. Current node keeps 
   first part, and new node is inserted as the following sibling to the 
   current node and body is set to second part
   - 
   
   shift-lines-to-previous-sibling
   extracts first lines from the current body up to the cursor and append 
   them to the previous sibling node
   - 
   
   shift-lines-to-next-siblings
   extracts lines from cursor to the end of current body, and prepends them 
   to the next sibling node
   - 
   
   advance-js-block
   moves cursor down to the end of next block. If line at cursor starts 
   multiline expression, moves cursor at the end of that expression, else 
   moves cursor to the next line that starts multiline expression. Executing 
   this command several times moves cursor several blocks ahead.
   - 
   
   extract-current-block-in-section
   extracts all lines from the current cursor position to the end of 
   current syntax block and put them in new section node. User is expected to 
   type name of the section.
   
This is what I made as a note to myself to do when I find the time. Feel 
free to rename commands anyway you like. The only challenging command is 
advance-js-block. I believe I have solved this already and wrote about it 
HERE <http://computingart.net/fpfproto-2.html>. It is not the final version 
published there. There were some tweaks necessary to better support regex 
skipping. I haven't got time to publish new improved version, but if there 
is interest I can send you a copy. 

Also, similar command advance-js-block, can be made for other languages and 
buttons can be shown/hidden depending on the file extension or language 
directive. I thought to make a plugin importing_tools from this commands 
and gui pane. 

Vitalije

PS: I haven't explained how these commands should be used. User would 
import whole file in one node, and then start reading code and chopping it 
up, using these commands. Hope this is more or less obvious. 

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to