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.

Bug 244498

Summary: Syntax Highlighting in HEREDOC / NOWDOC
Product: editor Reporter: w_barath
Component: Formatting & IndentationAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal CC: cagils
Priority: P3    
Version: 7.4   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:

Description w_barath 2014-05-14 23:53:07 UTC
Could someone please change the HEREDOC / NOWDOC behaviour to use the EOF argument as a hint for syntax highlighting, and if one matches, perform syntax highlighting instead of treating it like a string?  That would make the editor content a hell of a lot more semantic:

<?
# this block should be syntax highlighted as ECMAScript:
$JS=<<<'ECMA'
jQuery(function($){
  $("#id").click(function(){
    $(this).css({background:'red'});
  });
});
ECMA;

# this block should be syntax highlighted as inline HTML/CSS:
$CSS=<<<'CSS'
#id {background:green;}
CSS;

# this block should be syntax highlighted as HTML:
$BODY=<<<'HTML'
<div id=id>Hello World</div>
HTML

# this block should be syntax highlighted as HTML (with interpolation):
echo <<<HTML
<doctype=html>
<html>
<head>
<script src=/media/jquery?1.8.2>
<script>$JS</script>
<style>$CSS</style>
</head>
<body>$BODY</body>
</html>
HTML