styled-components / webstorm-styled-components

styled-components highlighting support in IntelliJ editors
https://plugins.jetbrains.com/plugin/9997-styled-components
MIT License
375 stars 19 forks source link

Not working on 2019.3 ? #80

Closed fatlinesofcode closed 4 years ago

fatlinesofcode commented 4 years ago

I just updated to PhpStorm 2019.3 and the highlight doesnt seem to work for me. Was working fine in 2019.2

Screen Shot 2019-12-17 at 1 44 44 pm

undeadcat commented 4 years ago

What plugin version are you using? There was an issue that prevented the plugin from working in 2019.3 but it was fixed in plugin v. 1.0.11: https://github.com/styled-components/webstorm-styled-components/issues/72

fatlinesofcode commented 4 years ago

im using plugin v1.1

undeadcat commented 4 years ago

@fatlinesofcode, It seems to work for me with the same versions and the same code sample. Are there any exceptions in IDE logs (you can view them via Help Menu -> Show Log)?

Is the example above enough to reproduce the issue for you in a new project or is there maybe something else missing from the example?

fatlinesofcode commented 4 years ago

hi @undeadcat I cant see any exceptions in the log.

I seem to be getting css suggestions but no syntax highlighting 🤔

Screen Shot 2019-12-18 at 9 54 12 pm

I'm on mac and used latest styled-components v5-rc2 (if that makes any difference)

undeadcat commented 4 years ago

Based on the latest screenshot where you're seeing completion and a red color picker icon on the gutter next to background-color: red, it seems likely that this plugin is correctly marking the string as styled-components.

This plugin only marks certain strings as styled-components, highlighting individual syntax elements inside them is the IDE's job and may depend on things like the particular IDE color scheme used.

Can you see if the issue exists with a different editor color scheme?

fatlinesofcode commented 4 years ago

thanks @undeadcat , yes looks like the issue related to the custom them i have. Plugin works fine with any of the default themes. Css and Scss files work fine with my custom theme. Any ideas on how I can fix my theme to also work with the plugin?

undeadcat commented 4 years ago

@fatlinesofcode, Unfortunately, I can't say for sure. Try it out with different CSS-related settings and different colors for JS strings. Or try the WebStorm support forum: https://intellij-support.jetbrains.com/hc/en-us/community/topics/200367229-WebStorm

fatlinesofcode commented 4 years ago

adding the fix here for archives :

In language injections, foreground color is normally taken from the injected language highlighting settings, unless the color is specified explicitly in Preferences | Editor | Colors & Fonts | General / Code / Injected language fragment, Foreground.. In my scheme I had it set to #F8F8F2. Clearing the checkbox should fixed the issue