IBM / zopeneditor-about

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

Ability to selectively deactivate certain snippets supplied with the extension #68

Open FALLAI-Denis opened 4 years ago

FALLAI-Denis commented 4 years ago

Description of the enhancement requested

Providing snippets with the Z Open Editor extension is handy for getting started quickly. However, some snippets may prove to be useless (for example we do not use IMS), or may not meet the programming standards of the site.

For example for Cobol, I identified these categories:

You should be able to deactivate certain categories of snippets.

For that, it would be necessary that the snippets are organized according to their purpose, maybe in separate files, and that activation / deactivation options are proposed in the settings of the extension. If it is not possible to configure the activation or deactivation of a category of snippets in the extension, then they should be managed in separate extensions, to be installed on a voluntary basis.

phaumer commented 4 years ago

Currently the offering management decision was made to ship everything in one VS Code extension to keep installation simple and not to confuse too much explaining the different components. One could argue that one does not want to download and see PL/I completely as well if you develop in COBOL. If we revisit this decision of breaking our offering apart we could revisit also the packaging of snippets.

FALLAI-Denis commented 4 years ago

Hi,

@phaumer

I think this request was closed a bit quickly and could have been kept as an enhancement. The idea of ​​isolating snippets in separate extensions was only a suggestion in case it was not possible to enable / disable snippets by categories at the level of the extension itself. Even if an activation / deactivation mechanism is not possible to implement, separating the snippets in different files according to their category would allow manual intervention at the level of the contributions of the file package.json. For example :

"contributes": {
  "snippets": [
    {"language": "cobol",
     "path": "./cobol-textmate/cobol-snippets-syntaxe.json"
    },
    {"language": "cobol",
     "path": "./cobol-textmate/cobol-snippets-code.json"
    },
    {"language": "cobol",
     "path": "./cobol-textmate/cobol-snippets-fullprogram.json"
    },
    {"language": "cobol",
     "path": "./cobol-textmate/cobol-snippets-sql.json"
    },
    {"language": "cobol",
     "path": "./cobol-textmate/cobol-snippets-cics.json"
    },
    {"language": "cobol",
     "path": "./cobol-textmate/cobol-snippets-ims.json"
    },
    {"language": "cobol",
     "path": "./cobol-textmate/cobol-snippets-vsam.json"
    },
   ... 
  ]

This division into files by categories could also facilitate the maintenance of snippets.

phaumer commented 4 years ago

Ok, I am reopening it and we could look at different ways of doing this if it receives a couple of upvotes. As you can easily filter by category already in the snippet gallery by typing I did not see the value of this.

FALLAI-Denis commented 4 years ago

Thanks :-)

Concerning the justification of the expressed need: as in charge of the implementation of the development tools, I am also in charge of the implementation of the norms and standards and the respect of these norms and standards. In this sense it should not be offered to developers some snippets that do not meet these norms and standards.

FALLAI-Denis commented 3 years ago

@phaumer

hi,

Consider also « zapp » snippets : they are associated with yaml language and are activited in all yaml files... this is disturbing as we use yaml files for other purposes than « zapp.yaml ».

Not sure that zapp snippets are usefull with a zapp schema activated : schema acts as snippets (ctrl+space insert code from schema).

phaumer commented 3 years ago

Thanks for the feedback.