question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No color highlighting when using function that returns code

See original GitHub issue

Describe the bug (including copyable syntax) No color highlighting when using function inside a styled component.

Example:

${({ $currentStep, theme }) => {
  if ($currentStep > 0) {
    return `
      padding: 10px 8px 10px 25px;

      @media (min-width: ${theme.breakpoints.md}) {
        padding: 10px 18px;
      }
    `;
  }
}}

Screenshot Screenshot 2022-03-11 at 7 55 52 AM

To Reproduce To reproduce, simply add a function that returns some css code into a styled component and no color highlighting will be shown.

Expected behavior CSS code should be color highlighted.

Build environment (please complete the following information):

  • OS: MacOS 12.2.1 (M1 chip)
  • VSCode Version: 1.65.2
  • Extension Version 1.7.3

Additional context Maybe related to this issue https://github.com/styled-components/vscode-styled-components/issues/358

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

4reactions
pzicommented, Mar 30, 2022

it’s not even just the colour highlighting, it’s also lacking autocompletion and suggestions.

3reactions
GollyJercommented, Apr 13, 2022

Yeah. Would be awesome not to have to use it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio Code color not working when using python ...
Reason: The Syntax Highlighting style provided by the extension " Python for VSCode " is different from the extension " Python ".
Read more >
C# syntax highlighting not working - Visual Studio Feedback
Since upgrading to VS 2019 I have been having syntax highlighting issues. ... the issue - but in many projects some of the...
Read more >
A case against syntax highlighting
Feel free to not use syntax highlighting, but if you work for me and I find a bug that would never have been...
Read more >
Syntax highlighting | ReSharper Documentation
Use the Color Identifiers checkbox to enable or disable ReSharper syntax highlighting. Click Save in the Options dialog to apply the ...
Read more >
Wrong color highlight for functions and methods. If a ...
If a function returns a function, its is not colored. ... `test3` isn't a "function" when you're reading through this code, it's a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found