adelf / idea-php-dotenv-plugin

environment parameters completion, based on .env file keys
MIT License
166 stars 13 forks source link

Syntax highlighting for single quoted values containing # #62

Closed christopher-hopper closed 3 years ago

christopher-hopper commented 4 years ago

Problem / Motivation

If a single quoted variable value contains a # character it is interpreted as the start of a comment. All characters following the # on the same line are highlighted as if they are a comment.

Screen Shot idea env syntax highlight

Steps to reproduce

  1. Create or edit an .env type file

  2. Add a new line with a variable and value like this

    FOOVAR=mybarval
  3. Wrap the value in single-quotes

    FOOVAR='mybarval'
  4. Insert a # character mid-way before the end of the value, like this

    FOOVAR='mybar#val'
  5. Change quotes from single-quotes to double-quotes , like this

    FOOVAR="mybar#val"

What do I expect

The syntax highlighting at step 3 and step 4 and step 5 doesn't change.

What actually happens

The syntax highlight at step 4 changes, showing the end part as if it were a comment. At step 5, when using double-quotes, the syntax highlight appears as normal.

christopher-hopper commented 4 years ago

Seems perhaps adjacent to issue #59