Author Topic: File Extension Manager's New Extension converts underscores to hyphens  (Read 7277 times)

PouncingPanda

  • Community Member
  • Posts: 74
  • Hero Points: 2
Go to tools->options
Select Languages->File Extension Manager
Click on New
Type "sgl_template" into the "Extension" field
type "xml" into the "Language" field
click on OK

This does not create a new file extension of sgl_template associated with xml, instead it creates a new file extension of sgl-template (hyphen, not underscore).

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 36
I did a little research into this one and found out the following: SlickEdit treats dashes and underscores the same in terms of file extensions.  So the extension will be displayed as sql-template.  But if you create a file named foo.sql_template or foo.sql-template, SlickEdit will recognize it as an XML file.

Obviously, this means that you can't create two different extensions, one sql-template and one sql_template.

SeeCwriter

  • Senior Community Member
  • Posts: 146
  • Hero Points: 1
I tried creating a new file extension and associating it with an existing extension in the File Extension Manager, but SlickEdit still doesn't recognize the new extension. Is there something else I'm supposed to do?

Steve

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 36
Could you please give me a little more info on what you've done?  Does your new extension show up in the list on Tools > Options > Languages > File Extension Manager?

SeeCwriter

  • Senior Community Member
  • Posts: 146
  • Hero Points: 1
Yes, the file extension shows up in the File Extension Manager extension list. But when I open a file with that extension, there's only black and white text. No color coding, no syntax recognition, etc. It acts like it doesn't recognize the extension.


PouncingPanda

  • Community Member
  • Posts: 74
  • Hero Points: 2
*bump*

I am observing the same effect - no color coding goodness for me.  Really annoying actually.

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 36
When you have your extension selected on the File Extension Manager, what language is listed in the combo box on the top right?

PouncingPanda

  • Community Member
  • Posts: 74
  • Hero Points: 2
Sandra - XML
I don't know about SeeCwriter.  My exact repro steps are in the initial post.

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 36
I assume your other regular XML files are working okay with lots of pretty colors and whatnot.  When you have a file of extension .sgl_template open in the current buffer and you go to the Document menu, does the "Select Mode (<language>)..." item indicate that you are in XML?

Sorry for the obvious questions, but I can't reproduce the problem here.  Thanks for you help!

PouncingPanda

  • Community Member
  • Posts: 74
  • Hero Points: 2
Yes, normal xml stuff is syntax highlighted just fine.  ATM so is sgl-template and sgl_template.  I guess I assumed the dialog changing the extension and the color coding not appearing after hitting 'apply' meant it wasn't going to work (I chose a different extension at that point.  Hell if all it takes is a reboot of SE which appears to be the case and it likes sgl_template despite claiming it is sgl-template I'm happy.  Thanks for looking into this Sandra.

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 36
OH!
So you already had a file of type .sgl_template open and then created the extension?  That makes more sense to me.  We're not checking the open buffers for the new extension.  And then once you exited, if the file was still open, SlickEdit would save its mode and not check for new extensions upon auto restore (if Auto restore files is True). 

In 12.0.3, we did run a check of open buffers to see if any of them used the new extension and then changed their modes.  I'll file a defect to make it work that way in 13.0.1.

I'm glad we finally got this worked out.  Thanks for all your help and patience.

PouncingPanda

  • Community Member
  • Posts: 74
  • Hero Points: 2
Thank you!