Search and display all Exceptions in VisualStudio2010 solution in a grouped view/list - visual-studio-2010

I am trying to find every exception used in within a big solution. I am doing this so I can replace generic Exceptions of Type "Exception" or "ArgumentException" with more specific ones.
What I tried at first was using the build in "Show Using"-Feature which, in case the Object is beeing used more than once" shows a nice tree-view of all the findings. It's great to navigate.
Only Problem ist that I don't know every Type that was used. If I use the normal search feature I get a simple List.
Using ReSharper I found that I can use the "Find" > "Search with PAttern" Feature. Only Problem here is that it is automatically case sensitive and "whole words" only.
Is there a build in feature like the "Usages"-Feature for a search?
PS: I also tried the "Find in File", that is just a list. I get every occurance of the word exception, which is helpfull but I lose the ability to navigate through a tree view.

You can use argument placeholders to search for anything that inherits from System.Exception
And I'm not sure what you mean about it being case-sensitive. I tried the below (notice that I'm in VB and I've failed to capitalize ThrowandNew`), but it still matched all the places I throw exceptions in my code.
I wasn't however able to search for just $type$, but this should catch any exceptions you throw in your code. You could try similar patterns to look for methods that handle exceptions. I'm using ReSharper 7.1.

Related

UiPath Get Text crashes robot

I'm trying to get a text from a textfield with Get Text, but in some cases this field is optional and the robot crashes because it doesn't have anything in the field.
You have multiple options. It's hard to say which one fits best you so here is a pool of possible solutions:
when NOT using the Modern Design, you can easily use the Element exists activity, self explaining
if you use the Modern Design and miss old activities like Element exists, go to the filter dropdown and select Show Classic, this way you are now also able to choose Element exists
you could also wrap such failing activities into a Try Catch, then your process wont fail, but a Try Catch should always be the last way out
when using the Modern Design, you can try Find Element, if the returned object is empty you know that it was not found, make sure to set a proper Timeout here, otherwise you wait for 30 seconds
but on your case it could be better to use an Image exists or Find Image Matches as you said you are looking for text in a textfield, just inverse it and look for an empty textfield, and if you have no matches all is fine
But to be honest, I would go for the Element exists. Give this a try, but be aware that in the future this activity might be replaced by something else and your process will need a little bit of rework.

Can QTCreator search for a specific warning or error and show all instances?

In example, let's say I want to search for all lines that have a warning about an extra semicolon (;). Can I search for that somehow?
I can easily look at the "issues" tab in QTCreator, but there's no way (as far as I know) to filter by type of issue. And if there are many, it's hard to find them.
Even more helpful, is it possible to search for macro-related issues, ie, unterminated conditional directive and show all files with an instance of it?

How to set priority in Microsoft Luis Patterns?

I am using pattern recognition to catch entities with a variable size. Here are situation that i am trying to catch
1- {entity1} (has| had| have) [the] {entity2}
2.1- {entity1} (has| had| have) the {entity2}
2.2- {entity1} (has| had| have) {entity2}
i tried the 1 pattern or the 2.1 and 2.2 at the same time.
The problem is that when i enter: "Person have the properties"
the entity2 is marked as "the properties" instead of just "properties"
Is there a way to mark priority or work around this problem?
Sorry for english mistakes i hope that the question is clear enough.
There is no way you can set priority in LUIS patterns. However, given your situation above, where the entity is getting extracted incorrectly, you might want to make use of explicit lists. You can create an explicit list via the authoring API to allow the exceptions when:
Your pattern contains a Pattern.any
When that pattern syntax allows for the possibility of an incorrect entity extraction based on the utterance.
Also, make sure to refer to the best practices(https://learn.microsoft.com/en-us/azure/cognitive-services/luis/luis-concept-best-practices#do-and-dont) for LUIS apps to make sure your app behaves with improved accuracy.
Hope this helps.

Is there a way to exclude unnecessary classes from a keyword search in MSDN?

When using "keyword search" in offline MSDN that came with VS2008, is there any way to exclude unnecessary classes / namespaces that I know beforehand is out of the scope of my search? The search "filter" seems way to broad for this purpose.
To be specific, when I search for a class, say "ListView", I DO NOT want System.Web.UI class to show up as the first suggestion just because it is the first one alphabetically, and instead would like to see System.Windows.Forms.ListView as the document that comes up. I guess I could live with going to search result and browse through to find the intended class, or maybe typing class names with full namespace... But it would make my life easier if I could either temporary or even permanently (I know I won't touch ASP.NET for a while) remove unnecessary classes from the search index.
TIA
After trying several options I found out that manually taking the .HXS files associated with the unneeded namespaces out of the MSDN directory (In my case, C:\Program Files\MSDN\MSDN9.0\1041) seems to do the trick. MSDN document explorer recreates help index on the next launch after the content of the directory was modified. So even in case you need the documentation again, you can restore the help by simply moving the files back into the original folder.
The files I moved to take out System.Web.UI documentations were:
fxref_system.web.ui.adapters.hxs
fxref_system.web.ui.desi_obilecontrols.converters.hxs
fxref_system.web.ui.design.hxs
fxref_system.web.ui.design.mobilecontrols.hxs
fxref_system.web.ui.design.webcontrols.hxs
fxref_system.web.ui.design.webcontrols.webparts.hxs
fxref_system.web.ui.htmlcontrols.hxs
fxref_system.web.ui.hxs
fxref_system.web.ui.mobi_s.adapters.xhtmladapters.hxs
fxref_system.web.ui.mobilecontrols.adapters.hxs
fxref_system.web.ui.mobilecontrols.hxs
fxref_system.web.ui.webcontrols.adapters.hxs
fxref_system.web.ui.webcontrols.hxs
fxref_system.web.ui.webcontrols.webparts.hxs
Was pretty surprised when I saw this kind of somewhat primitive and forcible method to be the most effective...
Type "listview NOT System.Web.UI.ListView" for example - without the quotes :)

.NET/Winforms: need an example for a nice UI for exception displaying

I'm writing a little developer tool which will (among other things) display exceptions thrown from the code that the tool is currently inspecting. Since it is a developer tool I would like to display as much information about the exception as possible (at the least type, message, stack trace and a recursive InnerException) and do it in a way that is easy to comprehend and analyze.
Unfortunately I cannot think of a nice UI for this. Are there any good examples out there? I have access to DevExpress components if that helps.
Starting with the VS display, I'd look for:
omit null values (such as HelpLink == null, or InnerException==null)
Don't nest InnerException, it's basically a stack so represent it as such
In StackTrace, you could make the file name clickable (or at least easy to pick out and copy).
In StackTrace, Emphasizing the actual class and function name to make it stick out from the full namespace and signature garble.
Some more data reduction is possible, e.g. exception type displayed twice, but this takes careful handling not to swallow information either
You could consider a HTML view, either making it interactive by catching clicks, or using javascript.
Well the Visual Studio one does a fair job! I can't seem to upload an image from this PC, but there's an image here if you haven't seen it.
Everything shown in a dynamic table/tree-like structure, you can drill down into inner exceptions etc, everything is copyable, and there are expandable viewers for certain things (e.g. stack traces). Not pretty, but functional.
Whatever you do, make sure that the developer can copy and paste all the relevant information!

Resources