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.

Highlighting doesn't work when wrapping the result of a function

See original GitHub issue

This is an extremely obscure edge case, as I’m sure hardly anybody has had a need to do this. But I’m in the middle of writing a library and have a line which looks like this

const Bounds = styled(Stylable("div"))`
  box-sizing: border-box;
  display: flex;
`;

and the highlighting does not work. If I remove the ("div") it works.

I’m a bit busy atm (otherwise I’d fix it now), but tomorrow or sometime later this week I’ll try and fix this issue. Just wanted to open an issue so that there’s a documented record of it.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:10
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
patrikmolssoncommented, Aug 29, 2018

Don’t know if it’s related, but also it does not work when specifying the props type (Typescript)

const Button = styled.a<{ first?: boolean }>`
  padding: 15px 50px;
  margin-right: ${p => p.first ? '50px' : '0'};
`;

Although, it works correctly when defining them inline for the function parameter:

interface IButtonProps {
  first?: boolean;
}

const Button = styled.a`
  padding: 15px 50px;
  margin-right: ${(p: IButtonProps) => p.first ? '50px' : '0'};
`;
3reactions
pixelizecommented, Dec 5, 2018

I confirm the same thing here, example :

capture d ecran 2018-12-05 a 12 29 16

Do you this can be fixed ? Would be amazing 😃 thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Console syntax highlighting not working when RStudio has ...
When using RStudio with a project open, the console doesn't highlight function calls. (Console in lower right-hand corner)
Read more >
Enabling line wrap with React-Syntax-Highlighter?
The wrapLines is NOT about wrapping lines of code at a pre-defined length or the container width. It's about surrounding each line in...
Read more >
Example: Styling - CodeMirror
When defining an editor theme, you'll usually want to provide both a theme extension and a highlight style that looks good with it....
Read more >
Code blocks - Material for MkDocs - GitHub Pages
The following sections discuss how to use different syntax highlighting features with Pygments, the recommended highlighter, so they don't apply when using a ......
Read more >
highlight | InstantSearch.js - Algolia
Note that the value is already bound to the function inside a string template, so you don't have to provide it. For this...
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