spgennard / vscode_cobol

Visual Studio Code Extension for COBOL, JCL and MF Directive Files
MIT License
37 stars 16 forks source link

Synthax-Highlightning for CICS-Maps #311

Closed Usr613 closed 2 years ago

Usr613 commented 2 years ago

In our shop we use the extension .map for CICS-Map-Definitions. The vscode_cobol-Extension supports the extension .bms to highlight CICS-Map-Definitions. How can I add the extension .map for that? I can't find any settings for .bms-files in the options and no places where I can add .map. Is there a way?

GitMensch commented 2 years ago

You can adjust this via vscode settings, the following should do the trick:

        "files.associations": {
            "*.map": "bms",
        }

Depending on the use case you may use workspace setting or a user setting. If you build the extension on your own it can be added to https://github.com/spgennard/vscode_cobol/blob/5a6e33eebac83178bfebaa765111e941e2d277e4/package.json#L956..L962.

If the extension "map" is very common it could be added here, too, depending on this extensions' author.

spgennard commented 2 years ago

@Usr613 Is your map file a bms listing file similar too:

https://raw.githubusercontent.com/asucahidori/experiences/e00b98ce9fe98a65591a368b613f1b1e2afcd6c7/1_Maiframe/Cobol%2BCICS%2BDB2/TMAP01.map

If so, do the above suggestion is the wrong answer.

GitMensch commented 2 years ago

... it is the answer to the question asked. But it seems there are different formats for CICS maps - do you consider adding the other format (possibly with the ".map" extension), too?

spgennard commented 2 years ago

@GitMensch Can we please wait until @Usr613 replies.

This example, is a listing file that contains a formatted bms file, which has line numbers, different divider lines.

So, this will break the formatting of a normal column-oriented bms file, so I would not recommend using the mapping .map to .bms, as it will cause numerous miss-matched colourisations.

Usr613 commented 2 years ago

Thanks a lot. It works. grafik

Usr613 commented 2 years ago

@spgennard Why is it the wrong answer? With the additionalFile extension my .map-Files are colored like the .bms-Files. The .bms-Files was colored in way that helped me a lot. And now I can name it .map. Which kind of miss-matched colourisations do you think of?

spgennard commented 2 years ago

If your .map files is a "pure" .bms file then this is okay, if your .map file "includes" a bms file along with title's/headerings & line numbers then the results will look okay'ish but if you look closely some of the colourisation will be off due to the unexpected line numbers.

If you try out the latest version, it has some tweeks, that will look at .map files when opened and if it looks a .bms file it will change to it, while also looking to see if it is a bms map file (one with line numbers), if this is true, then it will set it to the "bmsmap" language id, which handles line numbers & titles.

Usr613 commented 2 years ago

There are no includes. .MAP-File grafik

and .BMS-File grafik

look the same.