Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1624: syntax highlighting problems (templ., .inl)

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
DXer Posted - Dec 25 2007 : 7:00:48 PM
Hi guys,

I use VS 2008 C++ Professional with VAX 1624.

I have a template class matrix whose members are called _11 through _44 (defined in a union). The member functions are implemented in .inl files. This class is specialized for float, but the problems occur in both types.

In general there are quite a bit things that don't work correctly with this class. If I check the following problems in the .inl functions of the D3DXMATRIX class they don't occur (maybe because they are no templates).

I think I can't really explain the problems properly, so I have made a number of screenshots showing them:

1. initialization list:
some members are displayed like constructor function calls(red) and some like members/variables(blue)




2. inside function definition:
some members are displayed like variables(blue) and some are simply black(classes structs typedefs)




3. after scrolling down they are suddenly underlined as 'mistyped'




4. scrolling down this stops, but now we have case 2 again

I don't really know what to do with this^^ In my project there is one similar file showing such problems, but not as much as that. This is also an .inl file of a specialized vector template class: click
Refactoring or referencing those members or so doesn't work at all. Reparsing doesn't help either.



Another thing I want to mention is: The syntax highlighting is wrong if a function argument in an implementation is in the next line (with some tabs), e.g:
void geo2D::initProperties( dxr::graphics::drawBuffer* apBuffer, 
                   dxr::graphics::device* aGfxDev )

Here apBuffer is colored like variables and aGfxDev like classes;



EDIT:
Methods declerations are very often not highlighted if they have no arguments and no white space between the brackets:



I hope I could describe the problems properly,
Thx in advance
5   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jan 02 2008 : 08:23:31 AM
I have the file, thank you for this. I am seeing two apparently separate problems. Members of "rhs" are being underlined in the inline template function "dot" and sometimes the function is being coloured as a variable.

I am currently trying to pin down what is going on here.

For the colouring of enum items, open the VA options dialog, go to "Fonts and Colors" and hover the mouse over "Preprocessor macros" and the tooltip explains what this option will do
DXer Posted - Dec 29 2007 : 1:44:18 PM
I could reproduce the problem and created a small file showing it:

click

Edit: Why is <T> in calc coloured both like a class(in the signatur) and like a variable(in the definition)?

quote:
>> Is it normal that constructors and destructors are coloured like classes and enums are coloured like preprocessor macros?

Yes, this is how it should work.


Hmm then you should add this to the 'Tip of the Day' about syntax highlighting, coz it says that there is one colour for "Methods, functions, constructor and destructors".

rgds DXer
feline Posted - Dec 29 2007 : 12:30:12 PM
Do you have a short code sample that I could copy / paste into my IDE to test this problem with the dot function? In your second screen shot the function "dot" has the wrong colour, but I have no idea what the variable "u" is.


>> Is it normal that constructors and destructors are coloured like classes and enums are coloured like preprocessor macros?

Yes, this is how it should work.
DXer Posted - Dec 29 2007 : 09:52:27 AM
I've added .inl to VANet9.ExtHeaders. If I add it to C/C++-File Extensions in the IDE I get a lot of errors, because it is already listed in 'Extensions To Include'. Since I use VS 2008 I'm not completely sure if i got the right entries, but I think so. What makes me doubt is that Alt+O now only works with .h <-> .cpp. It used to show a popup with the corresponding 2 files and let me choose one of them.

EDIT: Now this problem is done as well, guess that VA just needed some time to scan my project again.

So now that this is clear to VA, nearly all of the former problems are solved. The methods in all non-template classes I think are now coloured correctly. In my templates there are still some minor problems regarding some specific methods; for example vector<T>::dot

utilities.inl:




matrix.inl:

Note that I've changed my syntax highlighting completely, as I found out how to make VA common with black backgrounds:
  • Classes (yellow)
  • Variables (bright yellow)
  • Macros and Enums (purple)
  • Methods (bright magenta)

The difference between the two above snippets is that the first and the second belong to a global function and the third belongs to a member function of matrix<T>. I see this pattern in every case:
global function -> vector::dot coloured like a variable
method (class) -> vector::dot coloured like a method

At last I'd like to thank u for helping me! I know that this is not one of the funny parts of developing VAX I really like the program and encourage you to keep on improving it

rgds DXer

PS: Is it normal that constructors and destructors are coloured like classes and enums are coloured like preprocessor macros?
feline Posted - Dec 28 2007 : 2:15:13 PM
When you open one of your INL files, is VA active? Are you seeing the context and definition fields? Is VA applying syntax highlighting?

It is possible VA does not know that these INL files are code files. This FAQ entry tells you how to add new extensions to your system so that VA will read the files as code:

http://docs.wholetomato.com?W328

I am finding your screen shots a bit hard to follow, simply because your syntax highlighting rules are so different to mine, I am not sure what the code is supposed to look like.

>> Methods declerations are very often not highlighted if they have no arguments and no white space between the brackets:

This is how I normally write declarations in my code, and they are always coloured correctly for me. Are you seeing this problem in all files? Some files? Is there any pattern to this? Is it connected with the template code, or is it unrelated?


In the template code you mention seeing some of it being underlined as mistyped symbols. This suggests that the colouring problems are happening because VA does not understand the code. This makes sense, since if VA does not know what the code is, it will not know how to colour it.

Are you able to reproduce any of these problems in a small file, one that you would be able to send me for testing purposes?

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000