pixelkind / p5canvas

An interactive preview for writing p5js code in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=garrit.p5canvas
Other
39 stars 4 forks source link

Pin p5canvas to one file #50

Open ccoenen opened 3 years ago

ccoenen commented 3 years ago

While working with multiple files (for example when dealing with classes), it would be great if p5canvas could be "pinned" to one file somehow. Right now, when I switch a tab, the p5canvas will try to run a class file, but will obviously not receive any draw instructions.

So, having the ability to keep p5canvas on my "main" file, would be helpful.

ccoenen commented 3 years ago

of course, the pinning should be optional, because it's also quite useful that p5canvas automatically displays what is active. I don't want to change that current behavior, I think that should remain the default.

pixelkind commented 3 years ago

I have thought about that already, but had no good solution for the UI. Do you have any idea for that? Dropdown of the available files and automatic to select?

ccoenen commented 3 years ago

I'm not quite sure, mostly because I don't know what VS Code / Codium allow you to do with appropriate amounts of work. My high-fidelity mockup features a neat pushpin that would allow you to pin this tab down.

grafik

ccoenen commented 3 years ago

also another possibility would be some heuristic that decides "this has no common p5js function calls on the top level, we're not switching to this file".