C# Implicit/Explicit variables in VS2015 CTP6 build

4 posts, 1 answers
  1. Paul
    Paul avatar
    8 posts
    Member since:
    Feb 2014

    Posted 05 Mar 2015 Link to this post

    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.

  2. Answer
    Nikolay Valchev
    Admin
    Nikolay Valchev avatar
    72 posts

    Posted 06 Mar 2015 Link to this post

    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.

     
  3. DevCraft banner
  4. Scott
    Scott avatar
    12 posts
    Member since:
    Jun 2014

    Posted 16 Sep Link to this post

    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

  5. Svetlozar
    Admin
    Svetlozar avatar
    270 posts

    Posted 21 Sep Link to this post

    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
Back to Top