Currently, in Visual Studio 15 RC when you're in a given position and the results form an _invalid_ code it might make sense to add an option to filter it out from the intellisense.
Here is an example:
public struct ConsoleContext : ICanWrite, ...
{
}
So the moment I type ICan I should no longer get either of these interfaces that were listed on the type unless I type ICanW... where in this case I expect to see ICanWrite again but this can be debated as it might confuse people although I don't think so.
_This suggestion might be applicable to more places._
Not sure I follow, are you suggesting not to include interfaces in the list that you have already inherited?
@miloush Yes, exactly but this is just an example, like I mentioned it _might_ make sense to do the same in other places where we can filter types that in a given context/position form code that wouldn't compile.
Not sure I follow, are you suggesting not to include interfaces in the list that you have already inherited?
It's more syntactic than that: if ICanWrite already appears verbatim somewhere in the text between : and {, then you will never want to write it and intellisense should not show it.
Otherwise, if it's inherited in another interface or base class in the list, you may still want to type it.
We have to be careful. Filtering out elements from intellisense can be confusing to people at times.
intellisense also comes up 'aggressively'. As such, we have to consider the fact that intellisense might be up, even though the user didn't invoke it manually. If intellisense then commits the wrong item, just because we chose to filter something out, that can negatively affect someone.
Note; this is not idle speculation. We do this sort of filtering to remove 'named parameters' from the intellisense list if you've already used them. And we have gotten feedback from people that this screws up their typing as they intend to rework the code and want to rewrite teh named parameter in another position.
@CyrusNajmabadi Yeah, I figured it may confuse people but I just thought it might be ideal in some cases.
The interface example I posted above was because I actually typed ICanWrite twice and didn't notice it at first so I thought this can be a good candidate for this feature.
Note; this is not idle speculation. We do this sort of filtering to remove 'named parameters' from the intellisense list if you've already used them. And we have gotten feedback from people that this screws up their typing as they intend to rework the code and want to rewrite teh named parameter in another position.
Visual Studio 15 has an improved intellisense so at the bottom there's all these filtering options, do you think it would make sense to add an option for a _smarter_ intellisense and add this sort of filtering as an option there? it can even be at the far bottom right to be separated from the type filters on the left.
_If you feel there's nothing to discuss here and this sort of behaviour is confusing even as an option I'd understand and close it._
IMO, there is extremely marginal benefit to the type of 'smarts' you're discussing. I don't think it's a bad idea. I just don't think it's ever going to be more important than the set of work we already have :)
Most helpful comment
IMO, there is extremely marginal benefit to the type of 'smarts' you're discussing. I don't think it's a bad idea. I just don't think it's ever going to be more important than the set of work we already have :)