d2 icon indicating copy to clipboard operation
d2 copied to clipboard

d2compiler: Scope style maps correctly

Open nhooyr opened this issue 2 years ago • 3 comments

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.

nhooyr avatar Dec 01 '22 12:12 nhooyr

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

alixander avatar Dec 01 '22 18:12 alixander

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.

nhooyr avatar Dec 01 '22 18:12 nhooyr

Noting #416 is the same issue

gavin-ts avatar Dec 16 '22 02:12 gavin-ts