Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Parse files with certain extensions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

maxim2000
Ketchup Master

68 Posts

Posted - Mar 11 2009 :  04:19:45 AM  Show Profile  Reply with Quote
Hello!

It would be nice if VA recognize and parse files with certain extensions.
For example, .rc and .rc2 files have some macros and includes.
The feature may be implemented in File Handling tab.
Alternatively, VA might parse all the opened files. Then user can ignore some extensions on the File Handling tab.

Thank you,
Max

feline
Whole Tomato Software

United Kingdom
18940 Posts

Posted - Mar 11 2009 :  4:08:12 PM  Show Profile  Reply with Quote
It depends on exactly what you are asking for. If you simply want VA to parse C++ with a custom file extension then you can already do it, as explained here:

http://docs.wholetomato.com?W328

However if you want VA to correctly parse some other file type then this is a very different thing. Firstly VA would have to actually understand the content / language of the file. Just adding the extension to a list is no use if the language is not supported.

zen is the art of being at one with the two'ness
Go to Top of Page

maxim2000
Ketchup Master

68 Posts

Posted - Mar 12 2009 :  04:46:43 AM  Show Profile  Reply with Quote
Actually, I want VA to correctly parse resource scrips. But no efforts are required to support this language.

You can find information about resource files here
http://msdn.microsoft.com/en-us/library/aa380599(VS.85).aspx

If I rename .rc file to .c I see exactly that I want. But probably you are right that this question should be considered as "new language support", and adding new extensions to parse is a wrong way.

Edited by - maxim2000 on Mar 12 2009 05:05:42 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18940 Posts

Posted - Mar 12 2009 :  10:16:22 AM  Show Profile  Reply with Quote
Have you tried adding .rc to the list of C++ extensions that VA supports, as described in the FAQ entry:

http://docs.wholetomato.com?W328

? Personally I do not work with or use .rc files, so I don't know much about them.

zen is the art of being at one with the two'ness
Go to Top of Page

maxim2000
Ketchup Master

68 Posts

Posted - Mar 12 2009 :  12:33:04 PM  Show Profile  Reply with Quote
Yes, the method works fine. Thank you.
It was enough to add .rc to VA's registry value ExtHeader, because .rc is built in extension.

Every VS project that contains resources (dialogs, icons, strings etc.) has .rc file. For example, all GUI applications use resources and have .rc files (one per project). So, it would be useful to support .rc by default.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18940 Posts

Posted - Mar 16 2009 :  11:05:15 AM  Show Profile  Reply with Quote
Looking in my main test solution I happen to have a .rc file. Opening the file I am noticing the lines:

LANGUAGE 9, 1
#pragma code_page(1252)
1           ICON         "app.ico"


and

1 TEXTINCLUDE  
BEGIN
    "resource.h\\0"
    "\\0"
END


This is not valid C++ code, so adding .rc to the default list of C++ file extensions does not make much sense.

What are you trying to achieve?

VA does do some parsing of .rc files, so it is aware of some of the symbols that the .rc files define.

zen is the art of being at one with the two'ness
Go to Top of Page

maxim2000
Ketchup Master

68 Posts

Posted - Mar 16 2009 :  1:17:09 PM  Show Profile  Reply with Quote
The code you noticed is resource script specific statements. Yes, there is no sense to parse them. But as you could see following by the link above, a resource script file can contain some C-constructions:
* Comments.
* Predefined macros.
* Preprocessor directives.
* Preprocessor operators, which are used with the #define directive.
* Pragma directives

First of all, I was trying to make alt-g workable. There are some custom macros and #include's in my .rc's. AFAIK, MFC also includes .rc2 in its .rc. This is a regular extension and I added it to ExtHeader together with .rc. It works fine too.

Modification of ExtHeader is easy and low-cost workaround for my problem. So, if VA's setup modifies the key (adds .rc and .rc2), it may improve VA quality.

May be VA somehow parses .rc files implicitly, but there is no navigation bar when I open them, and alt-g doesn't work.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18940 Posts

Posted - Mar 16 2009 :  2:04:45 PM  Show Profile  Reply with Quote
There is quite a bit of difference between "can contain C constructs" and "should be parsed as C code".

For now simply editing the registry on your machine is a good solution.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000