Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a custom file extension that has a dot (blade.php) in NetBeans?

I need to assign a custom extension to be recognized as a twig file in netbeans ('blade.php' as 'twig' file and give me syntax highlighting and code completion appropriately). The problem with using the File association option (in Tools > Options > Miscellaneous > Files) is that it won't let me add '.' in extension like blade.php, it works with single worded extensions like php, html, css etc.

Will be grateful if anybody can help me with this!

like image 311
CoCoMo Avatar asked Feb 15 '13 20:02

CoCoMo


1 Answers

Workaround I figured out and seems to work (at least Netbeans 8.x+)

  • Go to Tools > Options > Miscellaneous > Files
  • Click New
  • Enter blade as the new extension (you can use anything here, but this seems the most natural)
  • Click OK
  • In Associate File Type (MIME) select TWIG (text/x-twig)
  • Click OK of the whole Options window
  • Close Netbeans
  • Open the Netbeans configuration folder - on Windows it's %AppData%\Netbeans\<version>\
  • Go to subfolder config\Services\MIMEResolver
  • Open user-defined-mime-resolver.xml
  • Find the <ext name="blade"/> entry (or whatever you entred above)
  • Change the blade to blade.php
  • Save and close the file

Voilà, higlighting should now work in Netbeans IDE :)

like image 193
David Benedeki Avatar answered Oct 07 '22 03:10

David Benedeki