Skip to content

(Haxe) using new at the start of a variable name highlights it separately from the rest of the variable name #3992

@ninjamuffin99

Description

@ninjamuffin99

Describe the issue

When naming a variable with new at the start of the variable name (ex: newAngle), it highlights new separately from the rest of the variable (highlights new one color, then highlights Angle another color)

Which language seems to have the issue?
Haxe

Are you using highlight or highlightAuto?

I believe I am using highlight / highlightAll

Sample Code to Reproduce
(Sample code is from the haxeflixel.com documentation, the hosted documentation is using a bit of custom highlighting, but it's going to move to highlightjs, which you can test on dev.haxeflixel.com)

var newAngle:Float = 0;
 if (up)
 {
     newAngle = -90;
     if (left)
         newAngle -= 45;
     else if (right)
         newAngle += 45;
 }
 else if (down)
 {
     newAngle = 90;
     if (left)
         newAngle += 45;
     else if (right)
         newAngle -= 45;
 }
 else if (left)
     newAngle = 180;
 else if (right)
     newAngle = 0;

Expected behavior

Usually we'd want new to be highlighted differently (ex: creating a new variable state = new FlxState()), but when it's used as a variable, it should be highlighted as a variable rather than whatever the current implementation is for the new keyword.

Additional context
This error can be easily tested from the highlightjs online demo with nearly any theme: https://highlightjs.org/demo

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions