IBM / zopeneditor-about

IBM Z Open Editor: File issues here!
https://ibm.github.io/zopeneditor-about
Apache License 2.0
50 stars 20 forks source link

COBOL - Improve text colorization for syntax highlighting by textmate grammar #182

Closed FALLAI-Denis closed 1 year ago

FALLAI-Denis commented 3 years ago

Description of the enhancement requested

Currently the textmate grammar used for COBOL treats the source line globally.

The consequence of this is to color the identification zone identically to the syntactic element which precedes this zone. In the same way, the line number zone is interpreted (wrongly) according to its content: integer, text, keyword...

image

The COBOL texmate grammar should start by splitting the line into 3 parts:

The result might look like this (test on a partial COBOL grammar):

image

Already this would give better readability of the COBOL source code, and for example would make it possible to better identify a badly aligned identification label (shifted to the left of column 73). But it would also make it possible to prepare a future switch to free format for COBOL source lines: no more line number area or identification area, or even to be compatible with the extended format of the IBM COBOL compiler for Linux, (fixed format 252 columns).

Thanks.

gecolbert commented 3 years ago

This enhancement would be helpful to our development. We use the line number area and the identification area to link program changes to our change management documentation (primitive meta data). Having them colored differently would make the code easier to read.

kkrein commented 3 years ago

Ich bin derzeit nicht im Büro. Ich kehre zurück am 06.12.2021. Während meiner Abwesenheit bitte bei Postkorb SCM-Admin melden!

Die Rückmeldung bezieht sich auf ein Mail mit folgendem Thema: Re: [IBM/zopeneditor-about] COBOL - Improve text colorization for syntax highlighting by textmate grammar (Issue #182)


Gesendet (c) GRZ/RSG Linz 2021 Agent 'Abwesenheit'


Raiffeisen Software GmbH Firmenbuchnummer: 86804d, Landesgericht Linz UID: ATU 36961105

Der Austausch von Nachrichten mit dem oben angeführten Absender via E-Mail dient ausschließlich Informationszwecken. Rechtsgeschäftliche Erklärungen dürfen über dieses Medium nicht ausgetauscht werden. Correspondence with above mentioned sender via e-mail is only for information purposes. This medium is not to be used for the exchange of legally-binding communications.

FALLAI-Denis commented 2 years ago

This enhancement would be helpful to our development. We use the line number area and the identification area to link program changes to our change management documentation (primitive meta data). Having them colored differently would make the code easier to read.

I think this should be possible by using an injection grammar extension that enhanced the default grammar included in Z Open Editor : a « left » (?) grammar anchored on sequence area meta or identification area meta. So, the default grammar should have these metas.

Injection grammar extension can also handle « Report Writer » language extension.

https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide#injection-grammars

FALLAI-Denis commented 1 year ago

Solved since ZOE 3.0.x