IBM / zopeneditor-about

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

COBOL textmate - Support for comment in SQL statements #401

Open FALLAI-Denis opened 2 months ago

FALLAI-Denis commented 2 months ago

Description of the enhancement requested

Hi,

We would like the texmate COBOL grammar manage comments included in SQL statements.

COBOL code in IBM Z Open Editor: image

SQL code in IBM Db2 for z/OS Developer: image

Thanks.

FALLAI-Denis commented 2 months ago

Related issue:

FALLAI-Denis commented 2 months ago

This rule could work without the problem described in issue #402:

    {
      "begin": "(?i:exec\\s+sql)",
      "name": "string.quoted.cobol.sql",
      "patterns": [
        {
          "match": "(\\:([0-9a-zA-Z\\-_])*)",
          "name": "variable.cobol"
        },
        {
          "match": "(--.*)",
          "name": "comment.line.modern"
        },
        {
          "include": "source.sql"
        }
      ],
      "end": "(?i:end\\-exec)",
      "endCaptures": "string.quoted.cobol.sql"
    },
FALLAI-Denis commented 2 months ago

PS: rule for SQL comment is not mandatory if problem describe in #402 was solved, « source.sql » apply rule for SQL comment.

But COBOL floating comment « *> » should be managed in SQL comment.

Question: which extension(s) manage « source.sql »? For my tests on textmate improvement I desactivate « IBM Db2 for z/os developer » and SQL statement still managed…

RedCMD commented 1 month ago

that's not how "endCaptures" work it should be "endCaptures": { "0": { "name": "string.quoted.cobol.sql" } }