antiantisepticeye / vscode-color-picker

let's you use vscode's css color picker in other documents
45 stars 14 forks source link

doesn't work with Typescript .ts files #2

Open lookingwestapps opened 2 years ago

lookingwestapps commented 2 years ago

Love how this color picker is working, but I can't get it to work in Typescript .ts files.

When I edit a .ts file, none of the colors have the color picker box in front.

It works great in .tsx files, .json, and .js files.

This what I added to my vscode settings.json: "vscode-color-picker.languages": [ "typescript", "typescriptreact", "javascript", "json", ],

Thank you for any help!

antiantisepticeye commented 2 years ago

hmm seems to work for me tho, maybe try to reload vscode when you change settings, and make sure you have the latest version installed, previous ones are still a bit buggy sometimes image

lookingwestapps commented 2 years ago

Thank you so much for your reply and the updated documentation!

I got it to work by adding an empty line at the top of the file.

If I declare a color in the first line of the file, then none of the colors in the file have the color-picker box.

This gif shows the error and the workaround. colorPickerError

If you add an empty line or a comment as the first line then all the colors are picked up correctly.