Comments (10)
But
yarn add styled-components/vscode-styled-components
failed
Fixed at styled-components/vscode-styled-components#203 (hopefully someone merges)
even though the current version of the migration guide says both relative and absolute paths should work
Ah yeah, that was my intention, but I actually couldn’t find anything that Gatsby was passing me that would give me the location of the origin gatsby-config.js
So I pasted the absolute path and now I'm getting the above mentioned
TypeError: Cannot read property 'map' of undefined
. Any way to proceed here?
From that stack I have a guess. I think the issue is probably triggered by processing a markdown document that has no code blocks on it. I just did a YOLO commit, so a new alpha should be published momentarily if you want to try it out.
Thanks for the early feedback! Great catch!
from gatsby-remark-vscode.
Hmmm... that's odd. MDX highlighting isn't working when the config is
{
resolve: `gatsby-remark-vscode`,
options: { extensions: [`mdx`, `vscode-styled-components`] },
},
but when it's just
{
resolve: `gatsby-remark-vscode`,
options: { extensions: [`mdx`] },
},
it does work. I just checked again and it was also working with the absolute import from above. So apparently there is a slight difference in behavior depending on the import method. Seems weird but in a way this is still progress. At least the node module import does have an effect in that it breaks something. 😄
Just pushed a new branch with the update to the latest alpha in case you want to check it out.
from gatsby-remark-vscode.
@janosh I had a couple race condition bugs that only turned up when you have multiple extensions
in the array 😱
New alpha is published now.
from gatsby-remark-vscode.
That commit made line length too long for prettier 😄
from gatsby-remark-vscode.
Nice! Everything back to working now! My custom styles were gone but since the migration guide already has a helpful section on this that was a breeze to fix.
Btw, great solution to have extensions installed as node modules rather than manually downloading them. Like you said, it puts your dependencies where they really belong: into node_modules
where they are version-locked and CI-friendly.
Also, thanks for opening vscode-styled-components#203! I tried fiddling around with the scripts
section in their package.json myself during troubleshooting but didn't really know what I was doing.
One more possible bug. It might be that extensions downloaded as VSIX are not actually used. At least, this is what I'm seeing with the alpha
and this is how it's supposed to look
So either I'm doing something wrong or the absolute import of vscode-styled-components
has no effect.
{
resolve: `gatsby-remark-vscode`,
options: {
extensions: [
`mdx`,
`/Users/janosh/Projects/janosh.io/src/utils/jpoissonnier.vscode-styled-components-0.0.27.vsix`,
],
},
},
The yarn-installed MDX extension is definitely working.
from gatsby-remark-vscode.
Interesting. Can you try setting logLevel: "info"
and seeing if any clues appear?
from gatsby-remark-vscode.
Actually, it has nothing to do with the way the extension is imported. Just successfully installed yarn add styled-components/vscode-styled-components
and replaced the absolute VSIX import with the node module. Same problem, no styled components highlighting, so the issue is probably a little deeper than the import.
Adding logLevel: "info"
to the GRVSC options, I got:
Logs without `vscode-styled-components`
info Registering grammar 'text.html.markdown.jsx' from
info No language file was loaded for scope 'source.scala'
info No language file was loaded for scope 'source.scala'
info No language file was loaded for scope 'source.scala'
info No language file was loaded for scope 'source.scala'
info No language file was loaded for scope 'source.scala'
info No language file was loaded for scope 'source.scala'
info No language file was loaded for scope 'source.scala'
info No language file was loaded for scope 'source.scala'
info No language file was loaded for scope 'source.dart'
info No language file was loaded for scope 'source.dart'
info No language file was loaded for scope 'source.dart'
info No language file was loaded for scope 'source.dart'
info No language file was loaded for scope 'source.dart'
info No language file was loaded for scope 'source.dart'
info No language file was loaded for scope 'source.dart'
info No language file was loaded for scope 'source.dart'
info No language file was loaded for scope
info No language file was loaded for scope 'source.c++'
info No language file was loaded for scope
info No language file was loaded for scope 'source.asm'
info No language file was loaded for scope 'source.x86'
info No language file was loaded for scope 'source.x86_64'
info No language file was loaded for scope 'source.arm'
info No language file was loaded for scope
info No language file was loaded for scope 'source.sass'
info No language file was loaded for scope 'source.less'
info No language file was loaded for scope 'source.stylus'
info No language file was loaded for scope
info No language file was loaded for scope 'source.c++'
info No language file was loaded for scope
info No language file was loaded for scope 'source.asm'
info No language file was loaded for scope 'source.x86'
info No language file was loaded for scope 'source.x86_64'
info No language file was loaded for scope 'source.arm'
info No language file was loaded for scope
info No language file was loaded for scope 'source.sass'
info No language file was loaded for scope 'source.less'
info No language file was loaded for scope 'source.stylus'
info No language file was loaded for scope
info No language file was loaded for scope 'source.c++'
info No language file was loaded for scope
info No language file was loaded for scope 'source.asm'
info No language file was loaded for scope 'source.x86'
info No language file was loaded for scope 'source.x86_64'
info No language file was loaded for scope 'source.arm'
info No language file was loaded for scope
info No language file was loaded for scope 'source.sass'
info No language file was loaded for scope 'source.less'
info No language file was loaded for scope 'source.stylus'
info No language file was loaded for scope
info No language file was loaded for scope 'source.c++'
info No language file was loaded for scope
info No language file was loaded for scope 'source.asm'
info No language file was loaded for scope 'source.x86'
info No language file was loaded for scope 'source.x86_64'
info No language file was loaded for scope 'source.arm'
info No language file was loaded for scope
info No language file was loaded for scope 'source.sass'
info No language file was loaded for scope 'source.less'
info No language file was loaded for scope 'source.stylus'
info No language file was loaded for scope
info No language file was loaded for scope 'source.c++'
info No language file was loaded for scope
info No language file was loaded for scope 'source.asm'
info No language file was loaded for scope 'source.x86'
info No language file was loaded for scope 'source.x86_64'
info No language file was loaded for scope 'source.arm'
info No language file was loaded for scope
info No language file was loaded for scope 'source.sass'
info No language file was loaded for scope 'source.less'
info No language file was loaded for scope 'source.stylus'
info No language file was loaded for scope
info No language file was loaded for scope 'source.c++'
info No language file was loaded for scope
info No language file was loaded for scope 'source.asm'
info No language file was loaded for scope 'source.x86'
info No language file was loaded for scope 'source.x86_64'
info No language file was loaded for scope 'source.arm'
info No language file was loaded for scope
info No language file was loaded for scope 'source.sass'
info No language file was loaded for scope 'source.less'
info No language file was loaded for scope 'source.stylus'
info No language file was loaded for scope
info No language file was loaded for scope 'source.c++'
info No language file was loaded for scope
info No language file was loaded for scope 'source.asm'
info No language file was loaded for scope 'source.x86'
info No language file was loaded for scope 'source.x86_64'
info No language file was loaded for scope 'source.arm'
info No language file was loaded for scope
info No language file was loaded for scope 'source.sass'
info No language file was loaded for scope 'source.less'
info No language file was loaded for scope 'source.stylus'
info No language file was loaded for scope
info No language file was loaded for scope 'source.c++'
info No language file was loaded for scope
info No language file was loaded for scope 'source.asm'
info No language file was loaded for scope 'source.x86'
info No language file was loaded for scope 'source.x86_64'
info No language file was loaded for scope 'source.arm'
info No language file was loaded for scope
info No language file was loaded for scope 'source.sass'
info No language file was loaded for scope 'source.less'
info No language file was loaded for scope 'source.stylus'
Logs with `vscode-styled-components`
info Registering grammar 'text.html.markdown.jsx' from package mdx with language names: mdx,markdownreact
info Registering grammar 'source.css.styled' from package vscode-styled-components with language names:
info Registering grammar 'styled' from package vscode-styled-components with language names:
warn Encountered unknown language 'mdx'. If 'mdx' is an alias for a supported language, use the 'languageAliases' plugin
warn Encountered unknown language 'mdx'. If 'mdx' is an alias for a supported language, use the 'languageAliases' plugin
warn Encountered unknown language 'mdx'. If 'mdx' is an alias for a supported language, use the 'languageAliases' plugin
info No language file was loaded for scope 'source.scala' (requested by 'source.python').
info No language file was loaded for scope 'source.scala' (requested by 'source.python').
info No language file was loaded for scope 'source.scala' (requested by 'source.python').
info No language file was loaded for scope 'source.scala' (requested by 'source.python').
info No language file was loaded for scope 'source.scala' (requested by 'source.python').
info No language file was loaded for scope 'source.scala' (requested by 'source.python').
info No language file was loaded for scope 'source.scala' (requested by 'source.python').
info No language file was loaded for scope 'source.scala' (requested by 'source.python').
info No language file was loaded for scope 'source.dart' (requested by 'source.python').
info No language file was loaded for scope 'source.dart' (requested by 'source.python').
info No language file was loaded for scope 'source.dart' (requested by 'source.python').
info No language file was loaded for scope 'source.dart' (requested by 'source.python').
info No language file was loaded for scope 'source.dart' (requested by 'source.python').
info No language file was loaded for scope 'source.dart' (requested by 'source.python').
info No language file was loaded for scope 'source.dart' (requested by 'source.python').
info No language file was loaded for scope 'source.dart' (requested by 'source.python').
info No language file was loaded for scope 'source.postscript' (requested by 'source.python').
info No language file was loaded for scope 'source.c++' (requested by 'source.python').
info No language file was loaded for scope 'source.js.jquery' (requested by 'source.python').
info No language file was loaded for scope 'source.asm' (requested by 'source.python').
info No language file was loaded for scope 'source.x86' (requested by 'source.python').
info No language file was loaded for scope 'source.x86_64' (requested by 'source.python').
info No language file was loaded for scope 'source.arm' (requested by 'source.python').
info No language file was loaded for scope 'text.html.javadoc' (requested by 'source.python').
info No language file was loaded for scope 'source.sass' (requested by 'source.python').
info No language file was loaded for scope 'source.less' (requested by 'source.python').
info No language file was loaded for scope 'source.stylus' (requested by 'source.python').
info No language file was loaded for scope 'source.postscript' (requested by 'source.python').
info No language file was loaded for scope 'source.c++' (requested by 'source.python').
info No language file was loaded for scope 'source.js.jquery' (requested by 'source.python').
info No language file was loaded for scope 'source.asm' (requested by 'source.python').
info No language file was loaded for scope 'source.x86' (requested by 'source.python').
info No language file was loaded for scope 'source.x86_64' (requested by 'source.python').
info No language file was loaded for scope 'source.arm' (requested by 'source.python').
info No language file was loaded for scope 'text.html.javadoc' (requested by 'source.python').
info No language file was loaded for scope 'source.sass' (requested by 'source.python').
info No language file was loaded for scope 'source.less' (requested by 'source.python').
info No language file was loaded for scope 'source.stylus' (requested by 'source.python').
info No language file was loaded for scope 'source.postscript' (requested by 'source.python').
info No language file was loaded for scope 'source.c++' (requested by 'source.python').
info No language file was loaded for scope 'source.js.jquery' (requested by 'source.python').
info No language file was loaded for scope 'source.asm' (requested by 'source.python').
info No language file was loaded for scope 'source.x86' (requested by 'source.python').
info No language file was loaded for scope 'source.x86_64' (requested by 'source.python').
info No language file was loaded for scope 'source.arm' (requested by 'source.python').
info No language file was loaded for scope 'text.html.javadoc' (requested by 'source.python').
info No language file was loaded for scope 'source.sass' (requested by 'source.python').
info No language file was loaded for scope 'source.less' (requested by 'source.python').
info No language file was loaded for scope 'source.stylus' (requested by 'source.python').
info No language file was loaded for scope 'source.postscript' (requested by 'source.python').
info No language file was loaded for scope 'source.c++' (requested by 'source.python').
info No language file was loaded for scope 'source.js.jquery' (requested by 'source.python').
info No language file was loaded for scope 'source.asm' (requested by 'source.python').
info No language file was loaded for scope 'source.x86' (requested by 'source.python').
info No language file was loaded for scope 'source.x86_64' (requested by 'source.python').
info No language file was loaded for scope 'source.arm' (requested by 'source.python').
info No language file was loaded for scope 'text.html.javadoc' (requested by 'source.python').
info No language file was loaded for scope 'source.sass' (requested by 'source.python').
info No language file was loaded for scope 'source.less' (requested by 'source.python').
info No language file was loaded for scope 'source.stylus' (requested by 'source.python').
info No language file was loaded for scope 'source.postscript' (requested by 'source.python').
info No language file was loaded for scope 'source.c++' (requested by 'source.python').
info No language file was loaded for scope 'source.js.jquery' (requested by 'source.python').
info No language file was loaded for scope 'source.asm' (requested by 'source.python').
info No language file was loaded for scope 'source.x86' (requested by 'source.python').
info No language file was loaded for scope 'source.x86_64' (requested by 'source.python').
info No language file was loaded for scope 'source.arm' (requested by 'source.python').
info No language file was loaded for scope 'text.html.javadoc' (requested by 'source.python').
info No language file was loaded for scope 'source.sass' (requested by 'source.python').
info No language file was loaded for scope 'source.less' (requested by 'source.python').
info No language file was loaded for scope 'source.stylus' (requested by 'source.python').
info No language file was loaded for scope 'source.postscript' (requested by 'source.python').
info No language file was loaded for scope 'source.c++' (requested by 'source.python').
info No language file was loaded for scope 'source.js.jquery' (requested by 'source.python').
info No language file was loaded for scope 'source.asm' (requested by 'source.python').
info No language file was loaded for scope 'source.x86' (requested by 'source.python').
info No language file was loaded for scope 'source.x86_64' (requested by 'source.python').
info No language file was loaded for scope 'source.arm' (requested by 'source.python').
info No language file was loaded for scope 'text.html.javadoc' (requested by 'source.python').
info No language file was loaded for scope 'source.sass' (requested by 'source.python').
info No language file was loaded for scope 'source.less' (requested by 'source.python').
info No language file was loaded for scope 'source.stylus' (requested by 'source.python').
info No language file was loaded for scope 'source.postscript' (requested by 'source.python').
info No language file was loaded for scope 'source.c++' (requested by 'source.python').
info No language file was loaded for scope 'source.js.jquery' (requested by 'source.python').
info No language file was loaded for scope 'source.asm' (requested by 'source.python').
info No language file was loaded for scope 'source.x86' (requested by 'source.python').
info No language file was loaded for scope 'source.x86_64' (requested by 'source.python').
info No language file was loaded for scope 'source.arm' (requested by 'source.python').
info No language file was loaded for scope 'text.html.javadoc' (requested by 'source.python').
info No language file was loaded for scope 'source.sass' (requested by 'source.python').
info No language file was loaded for scope 'source.less' (requested by 'source.python').
info No language file was loaded for scope 'source.stylus' (requested by 'source.python').
info No language file was loaded for scope 'source.postscript' (requested by 'source.python').
info No language file was loaded for scope 'source.c++' (requested by 'source.python').
info No language file was loaded for scope 'source.js.jquery' (requested by 'source.python').
info No language file was loaded for scope 'source.asm' (requested by 'source.python').
info No language file was loaded for scope 'source.x86' (requested by 'source.python').
info No language file was loaded for scope 'source.x86_64' (requested by 'source.python').
info No language file was loaded for scope 'source.arm' (requested by 'source.python').
info No language file was loaded for scope 'text.html.javadoc' (requested by 'source.python').
info No language file was loaded for scope 'source.sass' (requested by 'source.python').
info No language file was loaded for scope 'source.less' (requested by 'source.python').
info No language file was loaded for scope 'source.stylus' (requested by 'source.python').
warn Encountered unknown language 'mdx'. If 'mdx' is an alias for a supported language, use the 'languageAliases' plugin
warn Encountered unknown language 'mdx'. If 'mdx' is an alias for a supported language, use the 'languageAliases' plugin
warn Encountered unknown language 'mdx'. If 'mdx' is an alias for a supported language, use the 'languageAliases' plugin
warn Encountered unknown language 'mdx'. If 'mdx' is an alias for a supported language, use the 'languageAliases' plugin
warn Encountered unknown language 'mdx'. If 'mdx' is an alias for a supported language, use the 'languageAliases' plugin
warn Encountered unknown language 'mdx'. If 'mdx' is an alias for a supported language, use the 'languageAliases' plugin
warn Encountered unknown language 'mdx'. If 'mdx' is an alias for a supported language, use the 'languageAliases' plugin
warn Encountered unknown language 'mdx'. If 'mdx' is an alias for a supported language, use the 'languageAliases' plugin
warn Encountered unknown language 'mdx'. If 'mdx' is an alias for a supported language, use the 'languageAliases' plugin
(Second run with a full-screen terminal because the lines don't wrap.)
Is GRVSC somehow not recognizing/marking the code blocks defining styled components such that they are not assigned to vscode-styled-components
?
from gatsby-remark-vscode.
I’m not sure what’s happening. I see the log where it finds the extension’s grammar registration, so it seems like it should be working. Will have to dig into it before launching v2. It’s also odd that I see it registering the MDX grammar under the language name mdx
, but later it says it doesn’t know what mdx
is. But your MDX code blocks are working ok?
from gatsby-remark-vscode.
Works perfectly now! 🎉
You can drop the alpha status now as far as I'm concerned. 😄
Just deployed it to production on my site. No issues as far as I can tell.
from gatsby-remark-vscode.
Awesome! Thanks again for trying it out and giving detailed feedback. Never would have found some of these bugs in tests!
from gatsby-remark-vscode.
Related Issues (20)
- option to show line numbers by default
- Feature request: Support for plaintext within inline code and consider plain text as default when no marker is set
- Version 3 Fails with ‘UNHANDLED REJECTION createNodeId is not a function’ HOT 3
- Not able to add additional languages HOT 2
- Clear tutorial or documentation how to add new language HOT 11
- Multiple language registrations can have the same scope/config
- Feature request: Title Header for the Script Name HOT 1
- Add horizontal scroll, have problems with longer code HOT 1
- sv language support HOT 1
- highlighting doesn't working with custom MDXProvider, MDXRenderer HOT 3
- Table layout causes diff and line highlight errors HOT 3
- Update for gatsby v3 HOT 11
- Passing arbitrary props directly with code fence options HOT 4
- Non-Gatsby Remark Plugin in MDSveX HOT 2
- When used without gatsby, injects styles when neither code spans nor code blocks have been found
- How to use the GitHub VSCode theme HOT 2
- Gatsby 4: Type with name "GRVSCCodeSpan" does not exists HOT 8
- Remove Gatsby peer dependencies HOT 3
- How to add Language Support for extensions not on NPM? HOT 1
- Comments in highlighted sections are stripped
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-remark-vscode.