Good idea, but I had the same issues as fourpastmidnight - a VS exception was thrown and the IDE did not accept further keyboard input. Needs fixed up, potentially a context menu item added to invoke the tool, some RegEx guidance text in the window and a mechanism to get the text back to the active editor, and it will be a nice addition. Remember the audience: people uncomfortable with regular expressions will be using this, so it should be a helpful novice/intermediate tool rather than aiming for the expert regular expression user.
Basically a good idea but not really usable. - Missing RegexOptions - German keyboard layout not supported - Bad documented how to open the regex editor - Not compatible with ReSharper
CONs: * Doesn't work well with non-english keyboard. * No undo-redo. * Window is Modal (can't copy paste from code windows for example). * Doesn't remember "Matches" string (you have to copy paste it in again and again). * Doesn't play well with ReSharper. * Causes code editor to become unresponsive.
Very useful extension. However, it needs to be fixed. When working in the editor for an extended period of time, it causes an Exception to be thrown in VS2010 (I have Premium installed, with SP1). You can continue to work, however, upon closing the editor, you can no longer type or navigate in the code editor. Navigation keys (e.g. arrows, etc.) either scroll through the document tabs (I have VSPT installed, so hitting the END key, for example, causes the IDE to activate the last tab in the document tab well), or other pieces of UI (such as focusable toolbar items).
When attempting to exit VS, a warning dialog appears that says "MS VS has detected that an operation is blocking user input. This can be caused by a modal dialog or a task that needs to block user interaction. Would you like to shutdown anyway?"
The only recourse is to save everything and exit and restart VS.
Also, can't use numeric keypad input, only the standard QWERTY keypad input.
But a tiny bug reports here: sometimes when I finished editing and testing the Regex in the pop up model window, and click "Accept" or "Cancel", then my VS editor area went zombie mode... I cannot type, delete nor copy. And when I try to close VS, a dialog popped up saying "Microsoft Visual Studio cannot shut down because a modal dialog is active. Close the active dialog and try again". The problem is, I was quite sure that I'd closed the regex editor dialog.
1. +1 please add to tools menu for stand-alone use (nothing seleted).
2. Should work with any string literal in the editor, not just the Regex class. Think about constants correctly defined in a separate region of the class or shared MyConstants class.
3. Consider enabling it in settings value editor too; business apps which match certain patterns may have regex's defined in their config files to allow administrator to change it later without need for coding work (flexible).
Nice work, although i do have problems with a portuguese layou keyboard.
Not sure why, but the textbox for the expression assumes I have an english keyboard (I believe it is because of the intelisense funcionality).
All other text inputs (Matches, filters) do understand my keyboard perfectly.
For example, when i press "]" in the Expression, it shows "\"...
Hi,
I use Visual Studio 2010 Premium and Resharper 5.0.
I've installed the extension (and verified it was indeed installed).
However, the extension does not work for me. I tried the following code:
Regex regy = new Regex();
What is the problem?
Thanks,
Janiv.
ReSharper (and I assume CodeRush) automatically puts a "();" at the end of the line.
E.G when you type "Regex regy = new ", ReSharper automatically puts the "Regex();" at the end. What you need to do is backspace to remove the "();" and then add the opening parenthesis. That will cause the editor to launch.
0. Add namespace if is missing: using System.Text.RegularExpressions;
1. Copy and paste this line to your code:
Regex regex = new Regex("D");
2. Press and keep Ctrl key (left or right).
3. Then move the mouse cursor on 'D' in expression.
4. Then click by left mouse button.
5. Regex Editor will appear.
Hi,
as Ricardo2F06FA already said, the Regex Editor extension does not support German keyboard layout.
I modified the code and it works now for me.
As I have not the possibility to test this with other keyboard layouts I really don't know if this works for others too, but it should :-)
Also fixed some small other things that weren't working.
Anyone interested can reply here and I will contact him.
Side note : I use ReSharper 5 and it works.
Regards,
Thomas.
Hi,
german keyboard layout is not supported, if i press "*" i get a "+" in the expression field.
CTRL+Click not the best way :-( "ContextMenu" extention?
The Pro Power Tools extension uses Ctrl+Click as "Go to definition" shortcut. Therefore when it is installed, it is impossible to show the regex helper window (Ctrl+Click just opens the metadata window for the class String).
As someone else has said, why don't you just put it on the Tools menu, or in the context menu?
It would be much nicer if I could attach the editor as a tab, dock it to a sidebar, or otherwise control where it moves around. Simply being a floating window isn't really ideal. It would also be nice if when that had been done, if I could select a regex from a dropdown or something and edit that one.
Having to pull it up off ctrl+click also isn't ideal. As MSX rules mentions, in the very least in conflicts with Pro Power Tools.
This causes an exception in VS2010. When I type:
var j = new Regex(
the Editor pops up and then immediately:
Visual Studio has encountered an exception. This may be caused by an
extension.
You can get more information by running the application together with the
/log parameter on the command line, and then examining the file
'C:\Users\me\AppData\Roaming\Microsoft\VisualStudio\10.0\ActivityLog.xml'
You then need to kill devenv.exe.
The log yields:
System.ArgumentNullException: Key cannot be null.
Parameter name: key
 at System.Collections.Hashtable.ContainsKey(Object key)
 at VisualSVN.VS.AbstractTextManager.RegisterBuffer(IVsTextLines textLines)
 at VisualSVN.VS.AbstractTextManager.GetBuffer(IVsTextLines textLines)
 at VisualSVN.VS10.WpfTextManager.GetBufferForView(IWpfTextView textView)
 at VisualSVN.VS10.QuickDiffMargin..ctor(IWpfTextView textView, ColorProvider colorProvider, WpfTextManager textManager)
 at VisualSVN.VS10.QuickDiffMarginFactory.CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
 at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.<AddMargins>b__2(IWpfTextViewMarginProvider mp)
 at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy`2 provider, Func`2 getter)