netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Enable Groovy syntax highlighting for Jenkinsfile

Open NicolaIsotta opened this issue 2 years ago • 1 comments

Description

It would be nice to have Groovy syntax highlightning for Jenkinsfile, but they do not have an extension, so it is not possible to set the Groovy mimetype for them under Option -> Miscellaneous -> Files -> File Associations

Use case/motivation

Example without higlight: image Example with: image

Related issues

No response

Are you willing to submit a pull request?

No

NicolaIsotta avatar Oct 12 '23 09:10 NicolaIsotta

So, it looks like the underlying implementation supports this, but not sure if there's any UI that does. The Open As action on files currently configures this for all files without extension - could perhaps be extended there to offer other options?

Adding a file in the userdir at <userdir>/config/Services/MIMEResolver/user-defined-mime-resolver.xml with the following contents will work -

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MIME-resolver PUBLIC "-//NetBeans//DTD MIME Resolver 1.1//EN" "http://www.netbeans.org/dtds/mime-resolver-1_1.dtd">
<MIME-resolver>
    <file>
        <name name="Jenkinsfile"/>
        <resolver mime="text/x-groovy"/>
    </file>
</MIME-resolver>

neilcsmith-net avatar Oct 23 '23 14:10 neilcsmith-net