Background:
For those of you not familiar with Monaco: it is a browser based version of
VS Code.
It is not compatible with VS Code because VS Code allows C based libraries
to be loaded; this is important because the syntax highlighters use some C
based libraries that don't work on Monaco.
Questions:
1. Is there a COBOL plugin for Monaco? (I looked, but I am asking anyway).
2. What is the list of COBOL plugins for VS Code and your opinion of their
functionality?
The context of this question is: I am intending to hire a person to convert
an open source VS Code plugin to work on Monaco (even if it is lower
functionality).
I want to preview the code of the VS Code plugins and pick the one that has
the simplest code.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It all depends what you expect - only syntax highlighting? That should be easy using only the tmLanguage - like this one: https://github.com/nberth/superbol-studio-oss/blob/master/syntaxes/COBOL.tmLanguage.json - or defining a complete "inbuilt" syntax definition that can then be upstreamed (which would have a lot of benefits including reasonable out-of-the box COBOL highlighting in vscode and other Monaco based editors as well as Windows file preview).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
And in any case: provide an example (with all usages and statements you care about) that should be highlighted correctly and may be also included in the Monaco repository as language example. You could use one of the contrib/sample repo files, possibly adjusting it. In any case I'd suggest to include common pitfalls (I may search for more later):
IDENTIFICATIONDIVISION.PROGRAM-ID.testprog.AUTHOR.tester. *-----------------------------------------------------------* * comment added in DATA DIVISION about stuff <- * more comments go here *-----------------------------------------------------------*SOURCE-COMPUTER.SPECIAL-NAMES.ALPHABETEBCDIC-FORMATISEBCDIC,ALPHABETASCII-FORMATISASCII.DATADIVISION.78 country-limvalue900.77 country-maxpic 9(3)valuezero.01 country-table.03 country-entryoccurs0 tocountry-limdependingoncountry-maxindexedby country-idxcountry-idx2country-idx305 ISOpic x(2).05 ISO3pic x(3).
And in any case: provide an example (with all usages and statements you
care about) that should be highlighted correctly and may be also included
in the Monaco repository as language example. You could use one of the
contrib/sample repo files, possibly adjusting it. In any case I'd suggest
to include common pitfalls (I may search for more later):
I need a COBOL plugin for Monaco.
Background:
For those of you not familiar with Monaco: it is a browser based version of
VS Code.
It is not compatible with VS Code because VS Code allows C based libraries
to be loaded; this is important because the syntax highlighters use some C
based libraries that don't work on Monaco.
Questions:
1. Is there a COBOL plugin for Monaco? (I looked, but I am asking anyway).
2. What is the list of COBOL plugins for VS Code and your opinion of their
functionality?
The context of this question is: I am intending to hire a person to convert
an open source VS Code plugin to work on Monaco (even if it is lower
functionality).
I want to preview the code of the VS Code plugins and pick the one that has
the simplest code.
It all depends what you expect - only syntax highlighting? That should be easy using only the tmLanguage - like this one: https://github.com/nberth/superbol-studio-oss/blob/master/syntaxes/COBOL.tmLanguage.json - or defining a complete "inbuilt" syntax definition that can then be upstreamed (which would have a lot of benefits including reasonable out-of-the box COBOL highlighting in vscode and other Monaco based editors as well as Windows file preview).
Thanks Simon.
I am going to focus on the syntax-highlighting only solution as that looks like a good first start.
Is this a good problem statement for what I am trying to do:
Please take this file:
https://github.com/nberth/superbol-studio-oss/blob/master/syntaxes/COBOL.tmLanguage.json
and convert it to a Monarch language syntax definition
Last edit: Simon Sobisch 2024-05-05
That's nearly a good description, but I'd be more specific:
Task: convert COBOL.tmLanguage.json to a Monarch language syntax definition with the end goal of contributing it to the monaco-editor.
For initial build and testing: https://microsoft.github.io/monaco-editor/monarch.html
Description what to do for including it: https://github.com/microsoft/monaco-editor/blob/main/CONTRIBUTING.md#contributing-a-new-tokenizer--a-new-language
For questions and tips see https://stackoverflow.com/questions/tagged/monaco-editor
Up-front check if you want to use https://github.com/spgennard/vscode_cobol/blob/main/syntaxes/COBOL.tmLanguage.json or https://github.com/OCamlPro/superbol-studio-oss/blob/master/syntaxes/COBOL.tmLanguage.json as basis.
Then define if your Monaco addition should cover fixed-form or free-form reference format or "something else". Also define it it should highlight ISO2002/IBM/MF/... directives or not.
And of course what set of reserved words should be included? All that GnuCOBOL handles (which includes the huge amount of ACUCOBOL extensions), only ISO2023, ???
And in any case: provide an example (with all usages and statements you care about) that should be highlighted correctly and may be also included in the Monaco repository as language example. You could use one of the contrib/sample repo files, possibly adjusting it. In any case I'd suggest to include common pitfalls (I may search for more later):
https://github.com/pygments/pygments/blob/master/tests/examplefiles/cobol/example.cob doesn't look bad for fixed-form COBOL and nicely includes variants for use of fixed-form code as well.
Last edit: Simon Sobisch 2024-05-05
This is a status report in case anyone wants to comment:
I did not find anyone that knew the monarch syntax and had any idea about
COBOL so we are trying to write this ourselves.
All the samples I find are too simple to be useful.
I used ChatGPT 4o and it actually came up with some code fragments that
kinda worked and we could patch up.
On Sun, May 5, 2024 at 9:49 AM Simon Sobisch sf-mensch@users.sourceforge.net wrote: