This discussion is archived
2 Replies Latest reply: Jan 23, 2013 3:33 AM by user550886 RSS

Unable to change File Type for specific file extensions

user550886 Newbie
Currently Being Moderated
Under Preferences->File Types different file extensions are assigned a file type e.g. The file extension .pkb is assigned the file type of PL/SQL. The file type of PL/SQL then opens the Code editor.

I have a user who would prefer to open .pkb files in the SQL Worksheet editor but I am unable to change the file type to SQL Script as the option is greyed out.

How do I change the File Type for these extensions? Is there a preferences file I need to change?

Version: 3.2.20.09

Thanks for your help.
  • 1. Re: Unable to change File Type for specific file extensions
    Gary Graham Expert
    Currently Being Moderated
    Hi,

    There is no preference but it turns out you can manually edit one of the preferences.xml files to force PL/SQL types to use the SQL worksheet editor. For SQL Developer 3.2.20.09.87 that file is system3.2.20.09.87\o.sqldeveloper.11.2.0.9.87\preferences.xml and will be located (on Windows 7, for example) in directory C:\Users\<userid>\AppData\Roaming\SQL Developer

    No guarantee this will work in future versions of the product, but for now you can add the following two xml blocks...
    For example, for .pls, add to <extensionToContentTypeMap ...>
                <Item>
                   <Key>.pls</Key>
                   <Value>TEXT</Value>
                </Item>
    
    and <userExtensionList>
                <Item>
                   <docClassName>oracle.ide.db.model.SqlNode</docClassName>
                   <userExtensions class="java.util.ArrayList">
                      <Item class="oracle.ide.config.DocumentExtensions$ExtInfo">
                         <extension>.pls</extension>
                         <locked>false</locked>
                      </Item>
                   </userExtensions>
                </Item> 
    I researched this a while back after reading through some forum thread where someone claimed the PL/SQL file extensions got opened in the SQL editor in his environment, but without stating any specific release information. Possibly it worked for him then due to different product behavior (whether intentional or a bug), or perhaps even due to the technique described above.

    Regards,
    Gary
    SQL Developer Team
  • 2. Re: Unable to change File Type for specific file extensions
    user550886 Newbie
    Currently Being Moderated
    Excellent. Thanks very much.

    In a future release can the File Types Preferences be left unlocked for all file extensions so changing the preferences.xml file won't be necessary?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points