Posted 12 years ago by Clint Brown - VP Development, eSSETS, Inc.

I have little chunks of code that I am using from time to time. Many code editors have a method for recording and retrieving such pieces of code.

I would think that having the editor record keystrokes is more difficult than just having a place to access named code snippets quickly. I'd be willing to type my snippets somewhere once in order to access it later, if that's easier than developing a full-fledge macro recorder.

There's one other idea proposed earlier by Lars Wallin. I'm not sure whether that's along the same line as what I'm describing since I don't use Github, but perhaps there's some synergy between both ideas.

Comments (2)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Clint,

Our SyntaxEditor control, the main editing component used in Code Writer, does support code snippet in its other platforms (WPF, Silverlight, WinForms).  We haven't ported that functionality over yet to WinRT, and as such it's not a part of Code Writer.  We do plan on moving those features over in the future though.

Right now to explain how it works, the code snippets mimic what Visual Studio does.  So there are code snippet shortcuts you can type, then press Tab, and it will insert the text of the code snippet.  Then you can additionally define fields in your snippets so while the snippet is active (right after insertion), you can tab between various fields you need to fill in.  An example is the variable name used in a "for" loop.

GitHub access is a similar concept in a way, except you are probably pulling down static code snippets from the cloud-based source in that scenario.

It would be cool to have more or less of a single way to browse through snippets from various sources.  For these more "local" snippets, how would you ideally want to list and access them?

Actipro Software Support

Posted 12 years ago by Clint Brown - VP Development, eSSETS, Inc.


I know that opinions on the method for accessing macros and snippets are going to be varied from user to user. I think that's a question that warrants more feedback than from me only. I have just a handful that I use on a regular basis. In other editors I've used, it's been handled by having the ability to name them, and then have them listed at the bottom of a macro menu. Of course that would look different in WinRT since the UI is quite a bit different.

I could see others preferring to have configurable hotkeys. I've never liked that myself because I already have a hard enough time remembering each software package's predefined hotkeys, let alone even more, but that's just me. I have the feeling the majority would like the flexibility to assign hotkeys.

I suspect many of your users of Code Writer have used Eclipse, Notepad++, and Visual Studio, among others. There's probably something to be said for considering how they do it.

I don't use Eclipse much, but my memory serves to think I had to find files in convoluted directories in order to code a macro. That's probably why I've tried to shove that out of my brain.

Notepad++ has a macro recorder, but I don't like it because I'm not careful enough to type an error-free macro the first time, and I haven't figured out how to modify a macro without recording it from scratch. I don't know enough about Visual Studio to know how it's done there.

For a while I used something called phpDesigner. As I remember, it had a fairly simple macro language, where one types out the string and has placeholders for inserting whatever text one highlighted before running the macro, as well as where to insert the caret. I could be confusing it with something else, though, it's been quite a while.

As I said, I think this topic deserves input from others. I think there must be a way to design a best of breed user interface if enough heads are put together on the topic.

As far as code completion is concerned, I think the fact that you have something in the works that mimics Visual Studio is great. It may not be perfect, but Visual Studio's implementation is pretty darn good in my opinion.

The latest build of this product (v4.2.42) was released 3 years ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.