cyrusfirheir / twee3-language-tools

[ VSCode extension ] Syntax highlighting and programmatic language tools for Twee 3, and Twine 2 storyformats.
https://marketplace.visualstudio.com/items?itemName=cyrusfirheir.twee3-language-tools
MIT License
47 stars 15 forks source link

SugarCube, bad highlighting for `$var.prop_name` #132

Closed felix9 closed 1 year ago

felix9 commented 1 year ago

SugarCube allows you to write $var.prop in the story text (and it allows a few minor variations of that).

T3LT will highlight the $var but not the .prop. This is not terrible, but $var.prop_name is highlighted wrong. _name is highlighted as a temporary var, but it's part of the prop name prop_name.

(Note: if there is some_word by itself, without $var. in front of it, then highlighting _word is ok, because SugarCube will substitute the temp var _word, but only if it is set. T3LT doesn't have a simple way of knowing if _word is actually set, so I think it's fine to mark it as "could be a variable". Making this more precise is a hard problem.)

cyrusfirheir commented 1 year ago

Fixed in v0.19.11. Please update.