hhvm / hack-mode

A Emacs major mode for editing Hack code
GNU General Public License v3.0
11 stars 11 forks source link

Clean up XHP region properties #25

Open Wilfred opened 5 years ago

Wilfred commented 5 years ago

Currently we set text properties but never remove them, resulting in modified code incorrectly being considered XHP.

Wilfred commented 5 years ago

As of c2c032e8c20e841dddadfd111ca36da5c225239a, a workaround is to restart hack-mode (i.e. M-x hack-mode) when this occurs.

Wilfred commented 4 years ago

I'm struggling to replicate this. Will reopen if I see it happen again.

Wilfred commented 4 years ago

OK, I can replicate.

// This will run, but it's not doing what the user expects. We never
// pass arguments to entry points.
<<__EntryPoint>>
function bad_variadic(mixed ...$_): void {}

Insert this into a file. Next, start typing a <?hh header before hand. Observe that the highlighting of __EntryPoint breaks.