This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I often have to write javascript, css or HTML code inside a PHP/PHTML file. 1. Here syntax highliting will work: <?php echo "test"; ?> <script type="text/JavaScript"> var v = "also test"; ... </script> But often I use heredoc and in Zend Framework it is the best to use view helpers like $this->headScript() and then it will not work. 2. Heredoc example: $js = <<<JAVASCRIPT var v = "also test"; JAVASCRIPT; 3. Zend helpers add correct starting tags and move the string to head part of page so I can't add my own SCRIPT tag which would help to highlight correctly. <?php $this->headScript()->captureStart(); ?> var v = "also test"; <?php $this->headScript()->captureEnd(); ?> Possible solution: I think mixed syntax higlighting is supported in PHP editor, becasue it works in example 1. I don't saw solution in other editors I worked with, but I would like at least to propose. heredoc: define reserved heredoc names (<<<HTML, <<<JAVASCRIPT, <<<) and use them as hints other situations: let user to define own (or define fixed) start/end strings assigned to highlight language. For example I would define in Netbeans configuration javascript=>("//jssyntax", "//.jssyntax") Then I would have to write: <?php $this->headScript()->captureStart(); ?> //jssyntax var v = "also test"; //.jssyntax <?php $this->headScript()->captureEnd(); ?>
This would be lovely. Updated version to 7.2 since it still does not exist.
I am looking for something similar, and if I know where to start looking the the source code I will see if I can start on a prototype. I would like to use the existing netbeans highlighting settings for the languages and just call them when I use heredoc <<<language_name language_name; If anyone could point me in the right direction that would be helpful Even if I knew where the definition of how heredocs is defined as a string that would help.
JetBrains PhpStorm has similar functionality.