Reputation: 1151
First, a little context as to what I mean. I've recently started learning some basics of Regex and wanted to try it in .NET. In Visual Studio 2019, while working in C#, I can make a Regex
object. I was astonished and amazed when I saw that Visual Studio is actually giving me hints as to the syntax of the "Regex language" (so to speak), which it will also color appropriately. Here is a picture of what I mean:
With that in mind, my questions is: Does this happen just because it is built-in to Visual Studio, to show this when editing this particular argument of Regex? Or, if not, how and where exactly is it stated how it should give hints for the string? Is it some sort of advanced <Summary>
like tagging?
Can I, for example, implement something like that for my classes so that custom hints are given out when making strings in my classes' methods?
Upvotes: 1
Views: 296
Reputation: 23760
Actually, what you saw is all the Intellisense that VS provides for Regex expressions.
And Intellisense that VS itself provides to the Regex expression is limited. And those are all.
Besides, Intellisense is a built-in tool of VS and we cannot get an easy way to change the build-in tool of VS unless you write your own vs extension that extends the Intellisense.
As a suggestion, you can search on the VS Marketplace to search if anyone has published such extension.
I have found that Resharper extension(It is a paid extension but the new user can use 30 days for free) has a powerful feature for Regex expressions.
See this document. It provides the better Intellisense and also has the feature to verify the regular expression.
In addition, if these still do not meet your requirements and you want to add some custom features, I suggest you could suggest a feature about your ideas to the DC Forum.
Also, you can share the link here and anyone including us will vote it so that it will get more Microsoft's attention.
Upvotes: 1