ReSharper calls inspection does not find a method - resharper

With R# 2017.3 I'm trying to find out whether method A through a call chain eventually might call method B.
So, I'm using Inspect->Incoming calls and try to use the filter field providing the method B name. Even though I know for sure that the method B is in the call tree, the Inspection UI does not find it.
However, if I click many times on "Expand All" and the method B appears in the UI, finally the search to find it.
Is this a bug or there is some setting that controls this behavior (e.g. nesting level)?

I've got the answer from JetBrains:
This behavior is by design because the calculation of the enŠµire call hierarchy at once could take a very long time.

Related

Intellisense for JavaScript in in VSCode doesn't recognize the type of this inside a class

Is there any way to make VSCode interpret the this keyword inside a member function of a JavaScript class as an instance of said class, thus providing intellisense for it's other members and properties?
I know that it is not necessarily the case when the function gets called, because it isn't automatically bound to the instance, but most of the time (at least in my experience) that is the desirable behavior, so it wouldn't hurt to assume the type of the this object to be a self-reference.
Update: After some time and guessing I think that I have figured out the problem, in fact it wasn't in Visual Studio Code, but in the class that I have written. You can find my solution attached as an answer.
Somehow after waiting for a while (I typed the question and then checked back on VSCode) the methods started to show up, and after looking into one of my other projects I realized that the classes I have written there have their properties showing up as well. After some trial and error I got to the conclusion that properties only show up if they are declared in the constructor, so the cause of my original problem was that I had a separate initialization method that assigned some additional attributes to the object.
Solution: If you need to assign some properties later, that the values of cannot be known at the time of the constructor running (for example because of asynchronous promises in my case), just assign undefined to them and VSCode will pick it up!

How to jump all dialog BOX by code?

Is there a way to jump all Dialog Box in standard code?
For example if in TaxVatTable.validateWrite call a class TaxVATNumValidateES\validateVATNum and here exist a BOX and I don't want to show, is there a solution?
Exist a way to disable dialog box function in all cases?
Yes you can, just modify the relevant methods in \Classes\Box.
The issue is those Box messages are a decision point being made by the user. So how do you know what they'll always choose? You can return the _defaultButton and probably be O-K in most cases.
They call different types of forms, but the one you're referring to is \System Documentation\Classes\DialogBox which is kernel code so the lowest point you can override it is at the Box class.
You can see how they short-circuit by doing this:
if (clientKind() == ClientType::COMObject)
return _defaultButton;
EDIT:
I want to add that I do NOT recommend doing this. Just change the code in the locations where it's called. You'd be functionally breaking part of the framework. Other developers may NEED to call this functionality at some point.
It's used on forms and all over the place. If you just make it always return Yes, you could cause ALL sorts of problems.

How to get data from custom properties in UITestPropertyProvider

According to the code sample on MSDN (http://msdn.microsoft.com/en-us/library/hh552522.aspx) any custom property data that you need to get out of your control should be in a semicolon delimited string in the AccessibleObject's Description property. This does not seem right to me at all. This seems like just a quick and dirty trick to get it working. What is the correct way to get the value of properties from custom controls? And if this actually is how you're supposed to do it, then how are you supposed to set those properties using the SetPropertyValue method? The example in the link above just throws a NotImplementedException in SetPropertyValue.
Since the IAccessible interface has only a limited number of properties the best solution is to cram any extra information into the Description property (that's what they do at the company I work at, and our developers don't work quick and dirty :) ). To modify the return value of this property you have to implement the Iaccessible interface on your control. Or, since you only want to modify the Description property you only need to modify that property and leave the rest to the proxy (I'm not sure how this works exactly but there are tutorials for it on MSDN).
The SetPropertyValue method in the UITestPropertyProvider is for the UItestControls. By overwriting it you can modify the way CUIT interacts with the control during playback. For example, if you overwrite SetPropertyValue for the Text property you can change the way CUIT types strings into the control.

Top-level exception handling for (visual) web parts

I've looked into this quite extensively and I've found the following:
You can do some clever stuff to catch most errors by implementing a base class, see Andreas Knudsen's solution for this.
The Error event in UserControl never gets fired, see details here: http://weblogs.asp.net/vga/archive/2003/06/16/8748.aspx
What I can't find is any general way to catch errors occurring in postback events, such as the click event for a button, at the web part or user control level. What I mean by general is a something I can implement in a baseclass.
I'm aware the I should do proper try/catch in my code, but for large teams I'd like to be sure that a web part never crashes the page, but always shows a nice message and allows execution to continue for the other web parts on the page.
I don't think it's possible but I'd love to be proved wrong.
Thanks,
Bjoern
I think this is possible, but you have to work around the fact that when asp.net distributes the postback events it couldn't care less about your user control definitions, instead it only cares about controls that explicitly implement IPostBackEventHandler (like button / dropdown etc)
For pages you can override and try/catch RaisedPostBackEvent like for the other methods. (if you ever wanted a generic page-exception handling setup. (if you want this then please reconsider. I spent way too much time in my last project basically reimplementing the default asp.net exception handling logic just to get this to work. the devil's in the details)
What you could do is to have a base page in your system which all pages inherit from and which overrides RaisePostBackEvent(source, eventArgs). In this method you could see if the source inherits from your exception handling base control, or if it is contained within a control which does this. (navigate the parent graph)
If it is contained by one then do a try/catch around the call to base.Raise.... (see the code in
Transparent generic exception handling for asp.net / MOSS2007 (with code) ) and call the exceptionhappened method on the first candidate you found if indeed any exceptions occur.

VS2010 modify intellisense popup order via an addin?

Is it possible to modify the order of the intellisense options shown when I hit ctrl-space?
Specifically, I'd like to order them in scope, so that if I have a variable in my function that matches what I've typed so far then it goes to the top of the list. If there's a member in the class, that's next, etc. I'm just kind of sick of having to type enough that I don't match some random global symbol in Windows' crypto libraries or whatever.
Is this kind of this possible? Where do I start? I looked for an obvious option in vs2010, but didn't find anything.
My programming language is native c++.
Here's what I've found so far.
A walkthrough showing how to add items to the intellisense popup: http://msdn.microsoft.com/en-us/library/ee372314.aspx
The walkthrough uses the ICompletionSession interface:
http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.language.intellisense.icompletionsession.aspx
It looks as if you might be able to clear the CompletionSets, and replace them with your own completion sets, but I'm not sure if there's any way to change the order, or if they are always sorted. There is the IIntellisensePresenter interface, but it looks like it's pretty much empty.
Also, from the walkthrough, it looks like you can fill the CompletionSets with a dumb list of strings, so you'd need some other way of interrogating the symbols to determine scope, which may not always be possible.
In short: Probably not possible at the moment.

Resources