Open franknoirot opened 8 months ago
What if there's other code that references the variable they're commenting out?
If we just let them comment it out it will break the code, that behaviour is fine if they are commenting it out themselves, they are taking charge of the code, but feels a bit weird if it's click a button to break your code kinda deal.
Maybe we warn them or something? not sure I love that though.
That's a good point, I'll have to revisit this because that is very non-trivial
we might just want to make "show" a real function here then
In tools like Figma and Onshape, entities can be toggled as visible/hidden with a click on an eye icon. In Figma, the open eye icon only appears on hover of a visible item in the entity (they call them "layers") sidebar, while a hidden item always has the closed eye icon, in addition to being faded in the sidebar to show a deactivated state
While we want to support an entity tree viewer in future when users don't have to touch the code so much, for now the Text Editor is our main entity control interface. Currently users can select a block of code and hit
Mod + /
to comment it out, but that is not a feature known to non-technical users who don't work in code editors all day.As a possible halfway point, we could show an eye icon next to any constant declarations in the code which, when clicked, toggles whether the entire expression is commented out or not.