apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.68k stars 855 forks source link

Enable Groovy syntax highlighting for Jenkinsfile #6560

Open NicolaIsotta opened 1 year ago

NicolaIsotta commented 1 year ago

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

neilcsmith-net commented 1 year ago

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>