1 comment

Hi Morty,

In the next nightly build we add special per-project option to handle your
suggestion. To use it, select a project in Solution Explorer and press F4
to show Properties window. There should be "Solution-Wide Inspections" field
with "On", "Internal symbols only" and "Off" values.

Valentin Kipiatkov
CTO and Chief Scientist
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi Ilya,

We use multiple solutions and public types are used in assemblies not
a part of the solution, and their unused-ness is usually wrong. The
same goes for frameworks that expose a public API that may or may not
be used at the present moment.

"Assembly Internal" types and methods are however never used outside
of the current assembly, which makes the warning that much more
important. So different warning levels for internal concepts and
public concepts? I realize that InternalsVisibleTo will cause a
problem, but that is an edge case in my opinion.

Does this make sense, or am I missing something?

Morty

"Ilya Ryzhenkov" <orangy@jetbrains.com> wrote in message
news:76a2bd0b16a47b8cb3f516f899096@news.intellij.net...

>> Hello Morten,
>>
>> What is so special about internal types in regards of used/unused
>> state? What is actual scenario you are facing and (as far as I
>> understood) ReSharper gives false positives in your solution?
>>
>> Sincerely,
>> Ilya Ryzhenkov
>> JetBrains, Inc
>> http://www.jetbrains.com
>> "Develop with pleasure!"
>> MA> OK, I misunderstood you.
>> MA> MA> I didn't realize that it ignored all attributed types?
>> MA> MA> What about an option to treat internal types differently than
>> public
>> MA> types as far as severity goes?
>> MA> MA> Morty
>> MA> MA> "Ilya Ryzhenkov" <orangy@jetbrains.com> wrote in message
>> MA> news:76a2bd0b16a4278cb3f48461d36c5@news.intellij.net...
>> MA>
>>>> Hello Morten,
>>>>
>>>> It shouldn't mark types annotated with attributes as being unused.
>>>> If this is not the case, this is probably a bug.
>>>>
>>>> Sincerely,
>>>> Ilya Ryzhenkov
>>>> JetBrains, Inc
>>>> http://www.jetbrains.com
>>>> "Develop with pleasure!"
>>>> MA> Hi Ilya,
>>>> MA> MA> This is a good idea, but can Resharper be configured to use
>>>> these
>>>> MA> attributes in its analysis?
>>>> MA> MA> Morty
>>>> MA> MA> "Ilya Ryzhenkov" <orangy@jetbrains.com> wrote in message
>>>> MA> news:76a2bd0b16a4178cb3f3b05c0f7bf@news.intellij.net...
>>>> MA>
>>>>>> Hello Morten,
>>>>>>
>>>>>> I usually mark such types with special custom attributes, like
>>>>>> or . This way you not
>>>>>> only supress the warning, but tell other people what's happening
>>>>>> here. Consider if there were no warning like that, but some other
>>>>>> developer use "Find Usages" on it and see no usages! It can
>>>>>> instantly delete type as not being used.n Plus, with custom
>>>>>> attributes you can easily find all types of particular kind.
>>>>>>
>>>>>> Sincerely,
>>>>>> Ilya Ryzhenkov
>>>>>> JetBrains, Inc
>>>>>> http://www.jetbrains.com
>>>>>> "Develop with pleasure!"
>>>>>> MA> What is the best way to handle code that is referenced in
>>>>>> custom
>>>>>> MA> configuration files or plugins loaded at runtime? In general
>>>>>> types
>>>>>> MA> that are not directly used in code?
>>>>>> MA> MA> Create a "placebo" file that uses all the types?
>>>>>> MA> MA> Is there a way to change severity on internal types or
>>>>>> methods
>>>>>> that
>>>>>> MA> are unused independent of public types?
>>>>>> MA> MA> Morty
>>>>>> MA>


0

Please sign in to leave a comment.