influxdata / vsflux

Flux language extension for VSCode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a Copy Script ID menu item

rickspencer3 opened this issue · comments

When a user right-clicks on a bucket, a script, etc... vscode should present some information about the entity. For example, what is the id of the entity?

Right clicking on a tree item brings up a context menu of actions so I am not sure if it makes sens to display additional information in item? I guess it might be possible to display menu items without any attached action? Otherwise we could either have an About action on the menu that displays additional information, or we could try to display this additional information when hovering over the tree item.

Planning to dig in on this tomorrow AM. Mostly I'll be using it as a vehicle to get more familiar with the vscode APIs and so on.

For the approach, an About action that presents the info in a panel or modal sounds like it could be a good first step. If the presentation/UX needs to change, at least we'd have the data handy to iterate with.

Reworking the scope a little bit after a discussion with @rickspencer3 and @rockstar.

I briefly looked at vscode's "show message" APIs but the modal we can present this way only accepts plain text (no nice formatting) and doesn't allow you to copy text. Part of the motivation for this feature was to be able to get the id of scripts so they could be invoked by other means, so it'd be annoying to be able to see the id and not copy it.

Adding a new virtual document, or webview to display the metadata for a resource could be an option, but it looks like there's some additional complexity in managing the lifetime of the panels in these cases. Not impossible but a little heavy.

We briefly discussed dumping the metadata out to the Output panel (essentially just logging it out). Seemed like this was a 👎 for UX.

Finally, it sounds like we settled on providing a "copy script id" menu item for scripts (only scripts). This will push the id into the clipboard, and we can probably "toast" a quick message indicating this happened.