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

Some syntax causes broken highlight.

Open iFwu opened this issue 7 years ago • 10 comments
trafficstars

70ceb97e-e127-4824-a688-e2ebf3ef6055

iFwu avatar Dec 12 '17 11:12 iFwu

+1 same for me

victordidenko avatar Apr 13 '18 12:04 victordidenko

Same here. I think it's the |css in this line but I don't know how to test VS extensions.

kennedyrose avatar May 22 '18 16:05 kennedyrose

@kennedyrose That's the same reason why this extension doesn't work with TypeScript, where we write styled jsx like this:

<style jsx={true}>{...}</style>

CC: @iFwu

athrunsun avatar Aug 29 '18 01:08 athrunsun

fixed

iFwu avatar Sep 07 '18 07:09 iFwu

Still experiencing this issue ("css`" causing all following code to be unhighlighted) with v1.0.0 installed in vs code on macOS Mojave. Have confirmed the version by running 'code --list-extensions --show-versions" in terminal, and it reports back "[email protected]"

Example screenshot attached

screen shot 2018-10-22 at 9 06 59 pm

readeral avatar Oct 22 '18 10:10 readeral

Thanks iFwu. Anything I can do to help let me know, but haven’t had a chance to dig into the source to determine the issue, sorry!

readeral avatar Oct 26 '18 07:10 readeral

@readeral The css`flex: 1;` doesn't match the external styles rule in the styled-jsx. That's why the syntax highlight is broken.

Is the css here use styled-components? I see the syntax of styled-components is something like this. Maybe you can disable the extension in the workspace that use styled-components syntax.

iFwu avatar Oct 26 '18 09:10 iFwu

No not using styled-components, using Emotion.sh

On Fri, 26 Oct 2018 at 8:52 pm, niceSprite [email protected] wrote:

@readeral https://github.com/readeral The "cssflex: 1;" doesn't match the external styles https://github.com/zeit/styled-jsx#external-styles rule in the styled-jsx. That's why the syntax highlight is broken.

Is the css here use styled-components? I see the syntax of styled-components is something like this. Maybe you can disable the extension in the workspace that use styled-components syntax.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/iFwu/vscode-styled-jsx/issues/4#issuecomment-433354112, or mute the thread https://github.com/notifications/unsubscribe-auth/APKtiF8xOsyqA21ANsrA6RvOS7j1S6iMks5uottngaJpZM4Q-1Wz .

readeral avatar Oct 26 '18 13:10 readeral

Confirmed that this extension breaks vscode-styled-components with Emotion and styled-components code.

This only started happening for me on the May 2020 version of VS Code (version 1.46).

Kapture 2020-06-19 at 14 50 36

See also:

  • https://github.com/emotion-js/emotion/issues/1316#issuecomment-486122598
  • https://github.com/styled-components/vscode-styled-components/issues/208#issuecomment-646606763

karlhorky avatar Jun 19 '20 12:06 karlhorky

@karlhorky This is happening to me as well. I just disabled vscode-styled-jsx for now, since I'm mainly using emotion and twin.macro (for tailwind)

tettoffensive avatar Jul 10 '20 16:07 tettoffensive