styled-components / vscode-styled-components

Syntax highlighting for styled-components
MIT License
917 stars 118 forks source link

Color picker does not register for color strings in .tsx files #363

Closed DanielHZhang closed 2 years ago

DanielHZhang commented 2 years ago

Describe the bug (including copyable syntax) The built-in VSCode color picker normally shows up next to color strings (i.e. hex, rgb) within typescriptreact and javascriptreact files. After updating to the newest version, these color strings are no longer considered ranges to trigger the color picker.

Screenshot Version 1.7.3:

image

Version 1.7.2:

image

To Reproduce Create a .tsx file with the following content:

const red = '#ff0000'

Expected behavior The built-in VSCode color picker appears next to the hex color string.

Build environment (please complete the following information):

jasonwilliams commented 2 years ago

Thanks for raising @DanielHZhang Would you be ok to work on this?

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

you would just need to clone this project, npm install, then launch the extension

zqy233 commented 2 years ago

Thanks for raising @DanielHZhang Would you be ok to work on this?

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

you would just need to clone this project, npm install, then launch the extension

I found it was the problem with “esbuild”, use "0.14.2" or "0.14.3" , it would be ok , but later version ,Color picker does not work such as "0.14.23" and "0.14.25"

vinibortoletto commented 2 years ago

I'm having the exact same problem. Started after 1.7.3 update.

jasonwilliams commented 2 years ago

Please don’t do “me too” posts. If you’re affected by this issue “thumb up” the original message. This gives me a better idea of who’s affected rather than creating noise.

jasonwilliams commented 2 years ago

This should be fixed in 1.7.4 https://github.com/styled-components/vscode-styled-components/releases/tag/v1.7.4

embostan commented 1 year ago

Doesnt seem to be fixed. Doesn't work in js, jsx, ts, tsx, json. It appears for half a second on window reload then disappears forever.