vscode-styled-components icon indicating copy to clipboard operation
vscode-styled-components copied to clipboard

Complete property with semicolon when typing jsx style properites

Open yunsii opened this issue 3 years ago • 3 comments

Describe the bug (including copyable syntax)

Look at gif below.

Screenshot

Enable extension:

styled

Disable extension:

styled-disabled

To Reproduce

Just typing jsx style properites.

Expected behavior

Not complete property with semicolon in jsx style properites, or complete property with comma instead.

Build environment (please complete the following information):

  • OS: Windows 10 20H2
  • VSCode Version: 1.63.2
  • Extension Version: v1.7.2

yunsii avatar Jan 17 '22 02:01 yunsii

same issue

  • Extension Version: v1.7.2

Profesor08 avatar Jan 21 '22 13:01 Profesor08

it's doable but I don't know if ill ever get around to this, would be good for someone to pick it up.

Setup Guide

https://github.com/styled-components/vscode-styled-components/blob/master/CONTRIBUTING.md

Command is here for adding semicolon. https://github.com/styled-components/vscode-styled-components/blob/master/src/insertColonCommand.ts

I think you'd somehow need to detect if you're in an object or not.

I would also inspect the completions passed here: https://github.com/microsoft/typescript-styled-plugin/blob/4f6ad2aae15098d74fd069d646a44ae368986af4/src/_language-service.ts#L259

they may have their own auto suggest which we could use instead of adding semcolons

jasonwilliams avatar Jan 25 '22 11:01 jasonwilliams

Facing the same issue when trying to set properties via the css function. I'll have to disable the extension until this is fixed. Would be cool if there was an option to disable this behavior too.

phiter avatar Jun 30 '22 20:06 phiter