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

Auto-completion affects non-styled syntax which resulting in semicolon suffix in Object. #299

Closed
iamyoki opened this issue May 28, 2021 · 10 comments · Fixed by #375
Closed

Comments

@iamyoki
Copy link

iamyoki commented May 28, 2021

Description

When I typing inside original style, it triggers vscode-styled-components auto-completion with semicolon suffix.

Screenshot
2021-05-28 14 11 54

Expected behavior

Don't bother original style syntax.

Build environment (please complete the following information):

  • OS: 11.2.2 (20D80)
  • VSCode Version: 1.56.2
  • Extension Version 1.6.3
@iamyoki iamyoki added the bug label May 28, 2021
@iamyoki
Copy link
Author

iamyoki commented May 28, 2021

I switched to v1.5.2, and it's fine.

@jasonwilliams
Copy link
Collaborator

@iamyoki would you be interested in working on this bug?

@anasyusef
Copy link

This issue also seems to happen when autocompleting React component props.

GIF
styled-components-bug

@gluons
Copy link

gluons commented Jun 9, 2021

Does it have any config to disable this feature? (I haven't found it)
I don't want to disable this extension but this problem bother me. 🥺😰

@anasyusef
Copy link

You can change the version back to 1.5.2 as suggested by @iamyoki

@jasonwilliams
Copy link
Collaborator

I will put in an option to toggle this feature

@jasonwilliams jasonwilliams added this to the v1.6.6 milestone Jul 26, 2021
@jasonwilliams
Copy link
Collaborator

Is someone able to knock up a small test case? Im unable to reproduce this issue :/
When i try to use style i don't get the auto complete in those situations.

I think it may be fixable without having to disable it but for that i need a tiny test case

@jasonwilliams jasonwilliams added the more info Needs More Info label Jul 26, 2021
@iamyoki
Copy link
Author

iamyoki commented Aug 5, 2021

QQ20210805-164840-HD

@jasonwilliams I tried to find a way to reproduce it, but I don't know how...

However, I found it was caused by 'extension.insertColonOrSemiColon' command.
Source code at

"extension.insertColonOrSemiColon",

@RJWadley
Copy link
Contributor

I can reproduce this issue in any object.

@jasonwilliams the following typeScript code reproduces the issue:

interface exampleType {
  color?: string;
  randomOther?: string;
}

let example: exampleType = {
  // press CTRL+SPACE and select "color" to reproduce the issue
  // note the issue doesn't occur when autoCompleting randomOther

};

it seems like any object key that is also a css property causes a problem

@jasonwilliams
Copy link
Collaborator

jasonwilliams commented Aug 16, 2022

Hmm I think we should just get rid of this feature and hope the typescript css/sass service can provide it instead. @RJWadley id accept a PR which just removes this command. I don’t think there’s any good way to know when we’re in a good place to enable it on/off

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

Successfully merging a pull request may close this issue.

5 participants