vscode: CSS in JS snippets do not work from Extension, only User Snippets
- VSCode Version: 1.33.1
- OS Version: 10.14.4
Steps to Reproduce:
- Install an extension I created - styled-components-snippets
- Reload VSCode
- Create a
.js
file - Try
imsc
snippet to make sure extension is installed. - Try
sc
snippet to create a Styled-Component.
At this point you should have this
import styled from 'styled-components';
const StyledDiv = styled.div`
`;
- Try
scp
inside the template literal like this
const StyledDiv = styled.div`
scp
`;
Does anything happen? It does not for me, and others.
-
Place cursor inside template literal like Step 6, open Command Palette -> Developer: Inspect TM Scopes.
-
Confirm it says
language: css
.
- Preferences -> User Snippets -> css.json
Add the following
"Use props inside styled-component": {
"prefix": "scp",
"body": "${props => props.${1}};",
"description": "Use props inside styled-component"
}
-
Save, Reload VSCode, and try step 6 again. It should work! The User Snippet works, but the extension does not.
-
Confirm the extension is correctly mapped to the CSS language on Github.
-
If you can confirm Step 11, and Step 12, why else would the extension fail here? Thank you.
Does this issue occur when all extensions are disabled?: Unable to answer as I need the extension to test it.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (5 by maintainers)
Holy crap
Edit: Upgrading and testing now. v0.2.6