Skip to content
This repository has been archived by the owner on Jun 30, 2024. It is now read-only.

Shouldn't highlight inside comments #4

Closed
julienp opened this issue Nov 19, 2016 · 7 comments · Fixed by #7
Closed

Shouldn't highlight inside comments #4

julienp opened this issue Nov 19, 2016 · 7 comments · Fixed by #7

Comments

@julienp
Copy link
Collaborator

julienp commented Nov 19, 2016

comment

The injectionSelector is set to L:source, which makes it apply inside comments and breaks highlighting for the rest of the file.

@wmertens
Copy link
Contributor

Similar issue:
image

it triggers off the ".css`" at the end of that string :)

@julienp
Copy link
Collaborator Author

julienp commented Nov 25, 2016

Good catch, thank you for the screenshot.

I haven't found a solution for the highlighting inside comments yet. Currently the plugin looks for matching regexes in the whole file, with "injectionSelector": "L:source". I've been trying to find the correct selectors to just match the places where a template string could occur, but seemingly there's none that matches any expression (something like L:meta.expr). This might be linked to microsoft/vscode#6858 (comment)

@ajhyndman
Copy link

See also: microsoft/vscode#2793

@mxstbr
Copy link
Member

mxstbr commented Dec 14, 2016

Running into this really badly in my project 😢 Super annoying bug!

@alpyre
Copy link

alpyre commented Dec 19, 2016

In my project I wrote:
'injectionSelector': 'L:source -comment'
...and it solved the issue for me.

wmertens added a commit to wmertens/vscode-styled-components that referenced this issue Dec 19, 2016
@kumarharsh
Copy link

@alpyre is there any place where all of these possible values for injectionSelector are documented? I've tried searching, but come up empty. I need something similar for my project (graphql-for-vscode).

@kumarharsh
Copy link

OK, after some digging, I found a few documents which highlight what all those textmate scopenames mean. Linking it here for anyone else stumbling on the problem: kumarharsh/graphql-for-vscode#7 (comment)

happydev1237 added a commit to happydev1237/styled_components that referenced this issue Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants