Author Topic: misc file extension will be tagged but won't be listed in preview window  (Read 3645 times)

Gilvin

  • Community Member
  • Posts: 86
  • Hero Points: 1
i have a file extension named ".uni", it contains unicode string token format as below:

Code: [Select]
#string STR_SMART_HARD_DISK_ERROR         #language eng  "SMART Hard Disk Error"
and after compile, it will be parsed into ".h" file, typical c++ format as below:

Code: [Select]
#define STR_SMART_HARD_DISK_ERROR                0x00AE
but in source code level, when i want to trace a code as below:

Code: [Select]
PrintToken (STRING_TOKEN (STR_SMART_HARD_DISK_ERROR));
the preview window will only show the parsed .h file, the uni file although have been tagged but will not be shown

but when i check the reference of STR_SMART_HARD_DISK_ERROR, the preview windows will show the tag.

so i guess the relationship is..

aaa.h
  ∟aaa.c
  ∟aaa.uni

but the real deal is the opposite:

aaa.uni
  ∟aaa.c
  ∟aaa.h
how can i do to catagorize  ".uni" files as a header file? thank you
« Last Edit: September 28, 2010, 02:49:03 am by Gilvin »

Gilvin

  • Community Member
  • Posts: 86
  • Hero Points: 1
Re: misc file extension will be tagged but won't be listed in preview window
« Reply #1 on: September 28, 2010, 10:46:54 am »
correct my post:

the uni file will only be in the reference window while it is opened as one of the buffers...

Gilvin

  • Community Member
  • Posts: 86
  • Hero Points: 1
Re: misc file extension will be tagged but won't be listed in preview window
« Reply #2 on: September 29, 2010, 11:06:01 am »
updated:

i reinstall slickedit, and create a new project, tag with reference option on, even makefile could get tagged, but only my .uni file couldn't.

the whole uni file format looks like this:

Code: [Select]
#string STR_PCI_EXPRESS_X16                   #language eng  "PCIExpressx16"
                                                                 #language fra    "xxxx"
                                                                 #language ita    "yyyy"
#string STR_MSC_VER_1500_VC9_0                 #language eng   "Compiler Version: VC 9.0"
#string STR_MSC_VER_1400_VC8_0                 #language eng   "Compiler Version: VC 8.0"
#string STR_MSC_VER_1310_VC7_1                 #language eng   "Compiler Version: VC 7.1"
#string STR_MSC_VER_1300_VC7_0                 #language eng   "Compiler Version: VC 7.0"
#string STR_MSC_VER_1200_VC6_0                 #language eng   "Compiler Version: VC 6.0"
#string STR_MSC_VER_1100_VC5_0                 #language eng   "Compiler Version: VC 5.0"
#string STR_MSC_VER_UNDEFINE                   #language eng   "Compiler Version: Undefine"

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: misc file extension will be tagged but won't be listed in preview window
« Reply #3 on: September 29, 2010, 04:43:01 pm »
Do you have a custom language defined for .UNI?
It does not seem to be natively recognized by SE.

It looked like you drew dependency diagrams.
SE is not showing dependencies, it is just showing lexical meaning.

In a .H file, #define defines a symbol.  So the tag parser treats those #defines as defining the symbols.  I don't think you can do anything about that (unless you write a macro to scan the tag file for various symbols, remove them, and replace them with a modified version of the symbol that better suits your needs -- but I don't think that will work well in practice).

If you have a custom language defined for .UNI files, make sure that it reports the #string symbol as a definition.  In that case there will be two definitions (one from .UNI, one from .H) and <Ctrl+.> on the symbol is expected to pop up a dialog asking which definition you are looking for.  When using <Ctrl+/> to find references it will pop up the dialog, but it can't tell them apart and will find all occurrences anyway (so why did it prompt? don't know).  Except it might leave out the competing definition, I'm not sure.

Gilvin

  • Community Member
  • Posts: 86
  • Hero Points: 1
Re: misc file extension will be tagged but won't be listed in preview window
« Reply #4 on: September 30, 2010, 02:13:13 am »
thx for the reply chrisant.

i have some unique file extension in the project, like .asl and .uni...etc

their syntax are similar to c/c++, so i catagorized them as c language.

and i added #string in the c/c++ preprocessor block.

the asl files could be correctly found, but uni couldn't.


chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: misc file extension will be tagged but won't be listed in preview window
« Reply #5 on: September 30, 2010, 04:27:24 am »
I can't find the similarity between the .UNI format shown earlier, and the C/C++ syntax.
The #language part looks like it will confuse the C/C++ parser.
I think you might need a parser designed specifically for the .UNI format.

Gilvin

  • Community Member
  • Posts: 86
  • Hero Points: 1
Re: misc file extension will be tagged but won't be listed in preview window
« Reply #6 on: September 30, 2010, 05:12:58 am »
thanks. maybe i got it wrong

is there a tutorial about customize context tagging?