Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

TS Definitions are a little overwhelming #295

Closed
quantizor opened this issue Aug 21, 2017 · 4 comments
Closed

TS Definitions are a little overwhelming #295

quantizor opened this issue Aug 21, 2017 · 4 comments

Comments

@quantizor
Copy link

quantizor commented Aug 21, 2017

I've been working on various benchmarks for styled components, emotion, glamorous, etc in VS Code and the defs for glamorous tend to be too verbose -- at least for me.

screen shot 2017-08-21 at 3 25 48 am

Due to them going to a second page and just generally taking up a ton of space, it sometimes inhibits keyboard usage. For instance, if you press the down arrow while that tooltip is open, it gets captured and pages down the giant list of available properties instead of going to the next line.

I definitely appreciate types being provided, but perhaps they could be slimmed a bit?

@luke-john
Copy link
Collaborator

luke-john commented Aug 21, 2017

hey @probablyup, the parameter hints are definitely a bit much for some parts of the typings.

I've got the following setting in my vscode user settings which means I rarely see them, but it would be great to simplify some.

{
    "editor.parameterHints": false
}

One of the easy wins here would be to use interfaces instead of types where possible. A few places where types are used were simply to cut down on the work of writing the same things over and over.

ie.

export type StyleArgument<Properties, Props> =
  | Partial<Properties>
  | string
  | StyleFunction<Properties, Props>
  | StyleArray<Properties, Props>

Unfortunately this has lead to the un ideal size of parameter hints.

I'll try and spend some time identifying low hanging fruit to improve this in the coming week and setup a tracking issue for these.

Edit: actually I might just use this as the tracking issue and update the title

@kentcdodds
Copy link
Contributor

Thanks! This would be great to improve. I have the same issue on Codesandbox. It's a tiny bit annoying. cc @CompuIves

@CompuIves
Copy link
Contributor

CompuIves commented Aug 21, 2017

Now deploying an option to use CodeMirror or to disable Automatic Type Acquisition! You can find it in Editor Preferences 😄

@luke-john
Copy link
Collaborator

@probablyup I ended up making the changes to improve this as it's a pretty big annoyance in the following pr.

#301

Related to this PR, I've opened up a seperate issue for comments to get added to the typings to help users when using the typings.

#302

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

No branches or pull requests

4 participants