Skip to content

[PHP] Detection of syntax highlighting when using heredoc #5010

Open

Description

@noelma

Description

The HereDoc syntax in PHP allows you to specify the string type.
I would like Netbeans to detect the type of string and apply syntax highlighting.

Use case/motivation

If the string type starts with a type known to netbeans, apply syntax highlighting to the string
Currently:
Capture d’écran du 2022-11-26 19-16-22
Goal:
Capture d’écran du 2022-11-26 19-16-39

Related issues

No response

Are you willing to submit a pull request?

No

Code of Conduct

Yes

Activity

  1. added
    kind:feature
    needs:triage
    on Nov 26, 2022
  2. changed the title [-]Detection of syntax highlighting when using heredoc[/-] [+][PHP] Detection of syntax highlighting when using heredoc[/+] on Nov 27, 2022
  3. added
    PHP
    on Nov 28, 2022
  4. the-liquid-metal commented on Nov 30, 2022

    @the-liquid-metal

    Lovely proposal, very useful for inline templating. I usually use phpstorm to do this, and i wish netbeans had this feature.

    Some considerations should be included:

    • including nowdoc
    • since sql has many dialects, popular dialect should be included (MYSQL, SQLSERVER, etc), rather than adding a note comment above the statement to clarify which dialect is.
    • including Doctrine
    • including popular language (Java, C#, etc). and most importantly: PHP ❤️
    • including popular html template (Twig, Blade, etc).
    • including popular css template (SASS, LESS).

    This is the first step towards becoming a more powerful feature. I hope netbeans won't stop here, considering phpstorm has very solid feature beyond syntax highlighting: syntax validation and connection to datasources.

  5. NReib commented on Feb 24, 2023

    @NReib
    Contributor

    I also support this feature request.
    The languages suggested by noelma could be a good starting point for having this feature. For me it would be ok to keep it at that, we don't need to have every language and dialect available by default.

  6. mokraemer commented on Feb 24, 2023

    @mokraemer

    I just stumbled across this feature request.

    I suggest adding nowdoc and heredoc. Maybe it is possible to start the specific engine for the language, so we get syntax highlighting and code completion.

  7. asafm7 commented on Oct 6, 2025

    @asafm7

    Great suggestion.

    Auto formatting will also be great.

    Possibly more relevant now with PHP 8.4's new ext-dom features and HTML5 support.

    There is a nowdoc in the official example:
    https://www.php.net/releases/8.4/en.php#dom_additions_html5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PHPkind:featureneeds:triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions