Ah, I see. You mean applying constant identifier highlighting to static readonly fields? It was discussed recently and we came to conclusion, that it is not always the same and some people, especially library developers, need to distinguish between the too. Constants are "inlined" by C# compiler, while static readonly fields are referenced from their origianl source. Thus, if you change constant value, users from other assemblies will not see new value, while if you use static readonly field code in different assembly will get new value. On the other hand, many developers don't need to care about this, because they work with self-contained solutions.
We thought about using two diferent slots in Fonts & Colors setting, which are initially configured to be the same. One for constants and another for static readonly fields. I'm not sure if appropriate request is filed in JIRA, but it should be easy to make such feature.
CB> Hello Ilya, CB> CB> Normal constants are limited to numbers and strings so you sometimes CB> have to use static readonly fields as constants. CB> CB> Regards, CB> >> Hello Chad, >> >> Do you mean something like "Field can be made static readonly"? >> >> Sincerely, >> Ilya Ryzhenkov >> JetBrains, Inc >> http://www.jetbrains.com >> "Develop with pleasure!" CB>>> Any chance of getting a "static readonly" hightlight in future? CB>>> CB>>> Thanks CB>>>
No, definitely its own highlight, I do apologize for my short replays that mislead you with regards to the original request intent. The main motivations would be to identify the sometimes referred to "runtime constants" from the "compile-time constants" in referenced assemblies.
Regards,
Hello Chad,
Ah, I see. You mean applying constant identifier highlighting to static readonly fields? It was discussed recently and we came to conclusion, that it is not always the same and some people, especially library developers, need to distinguish between the too. Constants are "inlined" by C# compiler, while static readonly fields are referenced from their origianl source. Thus, if you change constant value, users from other assemblies will not see new value, while if you use static readonly field code in different assembly will get new value. On the other hand, many developers don't need to care about this, because they work with self-contained solutions.
We thought about using two diferent slots in Fonts & Colors setting, which are initially configured to be the same. One for constants and another for static readonly fields. I'm not sure if appropriate request is filed in JIRA, but it should be easy to make such feature.
CB>> Hello Ilya, CB>> CB>> Normal constants are limited to numbers and strings so you CB>> sometimes have to use static readonly fields as constants. CB>> CB>> Regards, CB>> >>> Hello Chad, >>> >>> Do you mean something like "Field can be made static readonly"? >>> >>> Sincerely, >>> Ilya Ryzhenkov >>> JetBrains, Inc >>> http://www.jetbrains.com >>> "Develop with pleasure!" CB>>>> Any chance of getting a "static readonly" hightlight in future? CB>>>> CB>>>> Thanks CB>>>>
Hello Chad,
Do you mean something like "Field can be made static readonly"?
Sincerely,
Ilya Ryzhenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
CB> Any chance of getting a "static readonly" hightlight in future?
CB>
CB> Thanks
CB>
Hello Ilya,
Normal constants are limited to numbers and strings so you sometimes have
to use static readonly fields as constants.
Regards,
CB>> Any chance of getting a "static readonly" hightlight in future?
CB>>
CB>> Thanks
CB>>
Hello Chad,
Ah, I see. You mean applying constant identifier highlighting to static readonly
fields? It was discussed recently and we came to conclusion, that it is not
always the same and some people, especially library developers, need to distinguish
between the too. Constants are "inlined" by C# compiler, while static readonly
fields are referenced from their origianl source. Thus, if you change constant
value, users from other assemblies will not see new value, while if you use
static readonly field code in different assembly will get new value. On the
other hand, many developers don't need to care about this, because they work
with self-contained solutions.
We thought about using two diferent slots in Fonts & Colors setting, which
are initially configured to be the same. One for constants and another for
static readonly fields. I'm not sure if appropriate request is filed in JIRA,
but it should be easy to make such feature.
Sincerely,
Ilya Ryzhenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
CB> Hello Ilya,
CB>
CB> Normal constants are limited to numbers and strings so you sometimes
CB> have to use static readonly fields as constants.
CB>
CB> Regards,
CB>
>> Hello Chad,
>>
>> Do you mean something like "Field can be made static readonly"?
>>
>> Sincerely,
>> Ilya Ryzhenkov
>> JetBrains, Inc
>> http://www.jetbrains.com
>> "Develop with pleasure!"
CB>>> Any chance of getting a "static readonly" hightlight in future?
CB>>>
CB>>> Thanks
CB>>>
Hello Ilya,
No, definitely its own highlight, I do apologize for my short replays that
mislead you with regards to the original request intent. The main motivations
would be to identify the sometimes referred to "runtime constants" from the
"compile-time constants" in referenced assemblies.
Regards,
CB>> Hello Ilya,
CB>>
CB>> Normal constants are limited to numbers and strings so you
CB>> sometimes have to use static readonly fields as constants.
CB>>
CB>> Regards,
CB>>
>>> Hello Chad,
>>>
>>> Do you mean something like "Field can be made static readonly"?
>>>
>>> Sincerely,
>>> Ilya Ryzhenkov
>>> JetBrains, Inc
>>> http://www.jetbrains.com
>>> "Develop with pleasure!"
CB>>>> Any chance of getting a "static readonly" hightlight in future?
CB>>>>
CB>>>> Thanks
CB>>>>