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 16 forks source link

Restrict usage of macros to specific passages / files #83

Open MinusGix opened 2 years ago

MinusGix commented 2 years ago

There is a pattern where utility macros are defined for common things that are performed in a certain area of the game, but aren't intended to ever be used elsewhere.
It would be useful to provide a way for macros to specify that they can only be used inside specific passages or specific files, with the extension warning if it is used outside those.
A quick fix could be provided to autoadd that passage/file to the list.
This would help guard against misusing those macros elsewhere.