Author |
Topic |
|
Nels_P_Olsen
Senior Member
USA
47 Posts |
Posted - Jan 07 2004 : 10:46:55 AM
|
It is not all that uncommon to have C# code with a property or local variable with the same name as its datatype. This really confuses Visual Assist. I don't use Hungarian notation anymore (just too cryptic), and normally prefix member references with this.
It would be nice if there was an option such that when it encounters an identifier defined both as a member (or local variable) and a datatype, assume it's a datatype (class) reference unless explicitly prefixed, or part of the identifier's definition. |
- Nels |
|
support
Whole Tomato Software
5566 Posts |
Posted - Jan 07 2004 : 3:40:48 PM
|
As most forum users know, our coloring algorithm is not as smart as our full parser. The former is built for speed, particularly when coloring during scroll.
When a symbol is also the name of a class, the color of class holds.
Your suggestion to color as a variable foo in this.foo is reasonable. It fails when foo is also the name of a method, albeit in another class. (VA does not understand context when it colors.)
In any regard, we will try to improve what we do.
http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=139 |
Whole Tomato Software, Inc. |
|
|
Nels_P_Olsen
Senior Member
USA
47 Posts |
Posted - Jan 07 2004 : 3:56:05 PM
|
The class color holds when a member and a class both have the same name? That's what I'd like to happen in many cases (wherever not explicitly prefixed), but I see the opposite behavior -- everywhere in the source file, type references (local variable declarations, casts, etc) are colored in the "identifier" color ... |
- Nels |
|
|
Cezariusz
Tomato Guru
Poland
244 Posts |
Posted - Jan 07 2004 : 5:10:46 PM
|
quote: Underlining of typing and out-of-context errors is done by our full parser, hence one reason underlining disappears when you scroll and reappears after a pause in typing.
What about doing the same with coloring? I mean use dumb algorithm when scrolling and full parsing when idle.
|
Cezariusz Marek https://midicat.net/ |
|
|
Nels_P_Olsen
Senior Member
USA
47 Posts |
Posted - Jan 07 2004 : 6:43:58 PM
|
When a C# property has the same name as its datatype, not only do those datatype references get colored as variables, but in datatype completion dropdowns (when you start typing the full type name including namespace), the datatype is colored as a method (since in .NET, properties are transformed into getter and setter methods ...)
I also have many cases where method definitions are simply not colored with the "method" color at all, they end up colored as variables. Cases I can reproduce offhand are at the end of the source file -- VA appears to just quit trying to color method identifiers after a certain point (or internal error?) I'll have to experiment to see if this problem also appears in files without any properties named after their datatype ...
|
- Nels |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Jan 07 2004 : 10:58:47 PM
|
Nels: Can you get a few screen shots to us? Post in this forum or zip and email to [email protected].
We have considered often the suggestion from Cezariusz, ie to do smart coloring when idle. It has merit. One problem is we would switch to dumb coloring often, namely whenever you start typing. Symbols might change color often. We feel we'd just substitute one problem with another. |
Whole Tomato Software, Inc. |
|
|
Cezariusz
Tomato Guru
Poland
244 Posts |
Posted - Jan 08 2004 : 05:04:36 AM
|
quote: We have considered often the suggestion from Cezariusz, ie to do smart coloring when idle. It has merit. One problem is we would switch to dumb coloring often, namely whenever you start typing
Aren't currently most developer's machines powerful enough to cope with full parsing even after one starts typing (on user choice of course)?
|
Cezariusz Marek https://midicat.net/ |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Jan 08 2004 : 11:38:14 AM
|
Your PC might keep up if it had only to parse when you scroll. The problem is the rest of the IDE is running too and the people who wrote it assumed they had the whole machine to themselves. We must live within remaining CPU power at all times so we don't make the IDE sluggish. |
Whole Tomato Software, Inc. |
|
|
|
Topic |
|