This is a migrated thread and some comments may be shown as answers.

C# Implicit/Explicit variables in VS2015 CTP6 build

3 Answers 104 Views
Code Analysis
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
phburns
Top achievements
Rank 1
phburns asked on 05 Mar 2015, 06:18 PM
There is a confusing/conflicting set of options in JustCode for VS2015 CTP6.  

Under Code Analysis -> Problems -> C#, both of the options below were marked as warnings out-of-the-box. (Also, the explicit option has a misspelling.)


In addition to these two options being mutually exclusive, there is an option under Code Style -> C# -> General that allows a developer to prefer use of implicit variables.


Is there some way to tie these options together more, so developers aren't having to check 3 different things for one preference?  For example, if I want to use implicitly typed variables when the type is obvious, then "Not explicitly typed local variable" shouldn't be a warning.  If, on the other hand I never want to use implicitly typed variables (or "Only if necessary" since "Never" is not an option), then "Not implicitly typed local variable" shouldn't be a warning.

3 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay Valchev
Telerik team
answered on 06 Mar 2015, 07:45 AM
Hello,

Thank you for the thorough feedback!
You are absolutely right! These options in 'Code Analysis | Problems | C#' should be removed and only the one under 'Code Style | C#' should be respected as it is in JustCode for the previous versions of Visual Studio. I will log this as a bug and you can expect it being fixed in our next release.

Best Regards,
Nikolay Valchev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Scott
Top achievements
Rank 1
answered on 16 Sep 2016, 01:24 PM

Hello,

JustTrying out JustCode as an alternative to ReSharper and having a problem turning off the "Not Implicitly Typed Local Variable" warning.

I'm running both newest VS 2015 with JustCode. I go to the Justcode | Options | Code Style | C# | General and then make changes to the 'Use implicitly typed variable declarations'. I set it to 'Only if necessary' (and tried the other settings too) but the warning persists.

Is that the correct way to disable the warning?

I notice that if I click on the light bulb icon and then click off of the resulting combobox that the warning then goes away during that session, but appears again when reloaded later.

Please advise how to turn off this warning.

Thanks,

Scott

0
Svetlozar
Telerik team
answered on 21 Sep 2016, 10:05 AM
Hi,

Thank you for your question! 

The 'Use implicitly typed variable declarations' setting controls how you would like to configure the warning. If you want to completely stop it you can do it from JustCode Options | Code Analysis | Problems | C# | Arrange Variable declaration type. You need to save the settings, close and reopen the file.

Let me know if you have more questions. 

Regards,
Svetlozar
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Code Analysis
Asked by
phburns
Top achievements
Rank 1
Answers by
Nikolay Valchev
Telerik team
Scott
Top achievements
Rank 1
Svetlozar
Telerik team
Share this question
or