microsoft / typescript-styled-plugin

TypeScript server plugin that adds intellisense to styled component css strings
MIT License
839 stars 58 forks source link

No syntax highlighting when styled has second argument #101

Closed brandonkal closed 5 years ago

brandonkal commented 5 years ago

The syntax highlighting does not function when styled has a second argument:

const El = styled('div', options)`
    color: blue; /* This is not highlighted, though ts-styled-plugin still works */
`

The highlighting should occur regardless of the count of arguments provided to styled().

kobber commented 5 years ago

This also seems to be the case when using Typescript generic types:

const Button = styled.button<{
  color: string;
}>`
  display: inline-block; /* does not get highlighted */
`
brandonkal commented 5 years ago

My editor provides syntax highlighting for your example and I've never had an issue with highlighting when using type arguments.

Arynaine commented 5 years ago

I can second this. Though, funny enough, if you pull the code into the same line, highlighting works. If you put the types in multiple lines, it breaks.

This is a huge issue for me because I have to ignore my formatter every time need to use Typescript generic types just to get it working.

mjbvz commented 5 years ago

This repo/library does not provide syntax highlighting. Please file this against https://github.com/styled-components/vscode-styled-components