Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Make component props discoverable #120

Open
hughess opened this issue Jun 23, 2023 · 1 comment
Open

Make component props discoverable #120

hughess opened this issue Jun 23, 2023 · 1 comment

Comments

@hughess
Copy link
Member

hughess commented Jun 23, 2023

By adding slash commands, we're making it easier to discover the full list of available content and components within Evidence. Once you get a component on your page though, it's quite difficult to know what is possible without having the docs open side-by-side and referencing back and forth.

It would be great to have a way to surface the available props within a given component. Some alternatives in order of preference:

  1. Intellisense
    • Give user access to list of props scoped to the specific component they are in
    • Give user details on props and available options for each
  2. Hover tooltip
    • We can set up a "hover provider" based on keywords (e.g., <LineChart) and have a custom menu show up giving the user documentation about the component
    • This could optionally be paired with a decoration to the right of the component to prompt them that the information is there
  3. Tree View
    • Add a tree view to the extension to show all available components, their available props, and those props' available options
    • Would be nice to have this as a right hand sidebar (secondary pane)
    • If it's possible to add search bar / use input features, that would be great
  4. Full Prop Snippets
    • Add snippets showing the full list of props and defaults for each component
    • Likely too cumbersome to be worth it

Screenshots from trying a few of these out

Component Decoration (would be set up with hover capability on top of it)

CleanShot 2023-06-23 at 09 09 17@2x

Treeview

CleanShot 2023-06-22 at 15 35 03

CleanShot 2023-06-22 at 15 37 18@2x
@hughess
Copy link
Member Author

hughess commented Jun 27, 2023

I found a couple of options that let you take advantage of the existing grammar definition to get some language server-like capabilities. Seems like it would be worth going for a real language server unless these are easy to set up and work relatively well:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant