d2
d2 copied to clipboard
d2compiler: Scope style maps correctly
Right now style keys don't have to be under a style map. They can be a direct child of a shape and they will work.
We don't want this to work, such keys should be interpreted as child shapes instead.
when we last discussed this, the issue was that the syntax highlighting plugins can't determine scope. so it'd always look like these were reserved
We didn't decide to not scope style keys because of issues with syntax highlighting. I was just letting you know there's no way to fix the syntax highlighting to match our intended language semantics.
But syntax highlighting shouldn't guide every language decision. Here, I'd rather we have one absolute path to each style key and the path without the style.
prefix to be a shape, even if syntax highlighting cannot get it perfect.
Noting #416 is the same issue