Re: EdSharp and snippets

Mike and others,
At this point, EdSharp does not include an IntelliSense type of feature,
whereby one can complete the syntax of a coding element by picking from a
list.  Based on thisdiscussion, however, I have enhanced the Replace
Tokens command, Control+Shift+Equals in the January 18 release.  As
before, if text is selected,
EdSharp looks for tokens within it and replaces them.  a token is defined
in the [Tokens] section of the configuration file, e.g., via the Manual
Options command, Alt+Shift+M.  If no text is selected when pressing
Control+Shift+Equals, EdSharp now examines the chunk of text at the cursor
-- a sequence of characters bounded by white space.  If the cursor is
immediately following a word, the chunk is considered to be that word.

If the chunk starts with a % sign, EdSharp assumes it is a token, and
tries to look up its definition in EdSharp.ini.  If there is no percent
sign at the beginning, EdSharp assumes the chunk refers to a snippet
file in the directory of the current compiler (which you can confirm
with Alt+0).  You do not have to type the complete name of the snippet
file before pressing Control+Shift+Equals.  If there is more than one
match, EdSharp prompts with a list to pick from.

For example, suppose the current compiler is HTML Tidy.  Typing the word
"form" and pressing Control+Shift+Equals will invoke the snippet file
named form.txt.  On the other hand, the word "frame" will produce a
listbox, containing the frame and frameset snippets.

The word typed may actually be a regular expression, so ".*frame" will
produce a list that also contains the "iframe" snippet.

I am open to tweaking this functionality further, and hope it opens up
new possibilities.

Jamal
On Thu, 17 Jan
2008, Mike Terry wrote:

> Date: Thu, 17 Jan 2008 13:21:10 -0400
> From: Mike Terry <miketerry-lists@xxxxxxx>
> Reply-To: programmingblind@xxxxxxxxxxxxx
> To: programmingblind@xxxxxxxxxxxxx
> Subject: Re: EdSharp and snippets
>
>
> Jamal,
>
> I just tried the Ctrl+J within the snippets list and it does improve the task 
> of selecting a snippet in a long list of them.
>
> I took 30 seconds to read the documentation on tokens and am not sure that's 
> quite what I was trying to describe.  In other ides I've tried to use, it was 
> refered to code completion or expansion.  In the example I gave, the user 
> would press 5 keys to substitute the full snippet.  So I'd be typing the 
> letter "h", "t", "m", "l", and then press a hot key.  It's really just a 
> desire for speed when pounding out code.  The less time it takes to perform 
> the text replacement, the less difficulty you have staying in the mental zone.
>
> I don't think I've taken enough time to impress upon you how good EdSharp is 
> in my opinion.  I've looked at many text editors and script language ides; 
> however, they all suffer when it comes to usability for someone who is blind. 
>  At one point I stopped my search for a ruby/python/php editor/ide.  I found 
> EdSharp and was quite happy; however, after several days of intense coding, I 
> found my self googling again, because snippets were getting in the way of my 
> thought process.  Even though I found other editors with better support in 
> this area, after 20-30 minutes I found myself uninstalling and moving on.  
> EdSharp is the only one I've kept going back to.
>
> Mike
>
>
> *********** REPLY SEPARATOR  ***********
>
> On 1/17/2008 at 12:54 PM Jamal Mazrui wrote:
>
> >I appreciate the feedback, Mike.
> >
> >Note that you can use Control+J to jump to an item in a list-based
> >dialog, specifying any text within the name of the item -- not just the
> >initial letters.  You can press Alt+J to jump again.  That item will have
> >focus the next time you enter the same dialog, e.g., the one for choosing
> >a snippet to invoke.
> >
> >I think the Replace Tokens command, Control+Shift+Equals, is close to
> >what you describe.  I could probably tweak its functionality
> >without a lot of work.  If it does not operate quite how you would
> >want, let me know what would help.
> >
> >Jamal
> >ike modify itOn Thu, 17 Jan 2008, Mike
> >Terry wrote:
> >
> >> Date: Thu, 17 Jan 2008 09:25:46 -0400
> >> From: Mike Terry <miketerry-lists@xxxxxxx>
> >> Reply-To: programmingblind@xxxxxxxxxxxxx
> >> To: programmingblind@xxxxxxxxxxxxx
> >> Subject: EdSharp and snippets
> >>
> >>
> >> Jamal,
> >>
> >> I remember reading a post you made a while back in which you explained
> >that the alt+v snippets list did not support incremental searching because
> >of the way the control in the .net framework operates.
> >>
> >> have you considered an alternate form of snippet use.  Several editors
> >I've looked at will use the word under or immediately to the left of the
> >caret to identify the snippet to expand.  This seems much more natural to
> >me.  For example, I could start a new document, type "html" and press a
> >hot key to have it replace the "html" with a full template with proper
> >head and document type declaration.  I would of course like the dialog
> >prompting and all other facets of snippets, provided in EdSharp.
> >>
> >> If I were working with an unfamiliar list of snippets, then alt+v would
> >allow me to easily see what snippets are currently available and choose
> >one.  However, once I became familiar with the builtin or my own snippet
> >names, it would be much faster to just type the snippet name, press a key,
> >and fill in any popup dialog.
> >>
> >> Just a suggestion/wish.
> >>
> >> Thanks for a great editor.
> >>
> >> Mike
> >>
> >> P.S. I don't think I know c# nearly well enough to add this feature
> >myself.
> >>
> >>
> >> __________
> >> View the list's information and change your settings at
> >> http://www.freelists.org/list/programmingblind
> >>
> >__________
> >View the list's information and change your settings at
> >http://www.freelists.org/list/programmingblind
> >
> >
> >
> >--
> >No virus found in this incoming message.
> >Checked by AVG Free Edition.
> >Version: 7.5.516 / Virus Database: 269.19.5/1228 - Release Date: 1/16/2008 
> >9:01 AM
>
>
>
> __________
> View the list's information and change your settings at
> http://www.freelists.org/list/programmingblind
>
__________
View the list's information and change your settings at 
http://www.freelists.org/list/programmingblind

Other related posts: