Treat extensionless files as if .CBL

Get help with the installation and running of the Zeus IDE. Please do not post bug reports or feature requests here. When in doubt post your question here.
Post Reply
mfisher
Posts: 2
Joined: Fri Feb 07, 2014 2:25 pm

Treat extensionless files as if .CBL

Post by mfisher »

The COBOL source code files in my workplace have no file extension. I would like for these to be treated in Zeus IDE as though they were of the existing "Cobol Document Type". Is this possible?

What I've tried so far is:
  • open a file that does in fact have the .CBL extension
    go to Tools > Options, where settings for the COBOL document type are shown
    take screenshots of all of the tabs
    export the Templates and Keywords
    click OK
  • open a file that does not have any extension
    go to Tools > Options, where settings for the default document type are shown
    enter settings of which I had taken screenshots
    import the Templates and Keywords
    click OK
This does cause many things to work for extensionless files, like syntax highlighting, code folding, and autocomplete. But there is one very important feature that does not work: The "Go to Definition" context menu item (F12). (It does work for files that do have the .CBL extension.)

Is there anything I can do instead of, or in addition to, the above?

Thank you. So far it looks like a great programming tool.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

The COBOL source code files in my workplace have no file extension. I would like for these to be treated in Zeus IDE as though they were of the existing "Cobol Document Type". Is this possible?

Yes that is possible, but the solution is a bit combersome :(

Assuming your files is called something like: C:\temp\My_COBOL

To make that work as a COBOL source file you would need to do this:
  1. Edit the COBOL Document Type
  2. Select the Mappings Panel
  3. Add in a mapping for My_COBOL along with the cob file extension.
Now any file with the My_COBOL name will behave as a COBOL file.

But as you can see you would have to do that for that on a file be file basis which will be a problem if you have lots of files :(

Do you have many such files :?:

If so it might be better if I add option to that Mappings Panel to have a default mapping as well.
Thank you. So far it looks like a great programming tool.
Glad to see you're enjoying the Zeus experience :)

Cheers Jussi
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

One further point, while the above change will colour the document correctly, it will not fix the issue of the file not being correctly tagged.

As the file has no extension the ctags.exe will not know how to handle the file.

To fix this you need to open the xtags.ini file where you will see this line:

Code: Select all

Arguments=--c-types=+fp --excmd=p --fields=+afmikKlnsSz --sort=no --langmap=java:+.dart
You need to change that line to read as follows:

Code: Select all

Arguments=--c-types=+fp --excmd=p --fields=+afmikKlnsSz --sort=no --langmap=java:+.dart --langmap=cobol:+.
This change will mean any file without an extension will be assumed to be a COBOL file.

On Windows XP that file is found here:

Code: Select all

C:\Program Files\Zeus\
On Windows Vista or better that file is found here:

Code: Select all

C:\Users\<add your user id here>\AppData\Roaming\Xidicone\
Cheers Jussi
mfisher
Posts: 2
Joined: Fri Feb 07, 2014 2:25 pm

That worked

Post by mfisher »

Thanks for those responses. The solution you described does work (adding file-specific mappings and editing xtags.ini). :)

Since we do have thousands of these extensionless COBOL files, what I found most convenient is to edit the options for the default document type (as described in my earlier post). Then there is no need to assign file-specific mappings under Tools > Options. All I had to do after that was to edit xtags.ini.

Adding a default mapping would be a nice enhancement for a future release.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Adding a default mapping would be a nice enhancement for a future release.
I'll look to add that option to the next beta release.

Watch this space for more details ;)

Cheers Jussi
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

The latest beta adds an option to define a default mapping for files that don't have an extension.

This option is found in the Mappings panel of the Document Type dialog.

The latest beta can be found here: http://www.zeusedit.com/z300/z397s-beta.zip

To install this beta first make a good backup of your current Zeus folder (just in case) and then extract the files from the zip into the Zeus install folder.

Cheers Jussi
Post Reply