(sorry for my english skills) Did you know any ext or something to color paperscript code?
相关问题
- Extended message for commit via Visual Studio Code
- Where are Automatic Type Acquisition typescript de
- Typescript: Why doesn't visual studio code rep
- .NET Core 3.1 CreateHostBuilder Cannot parse JSON
- How to get VS Code debug data like breakpoints, st
相关文章
- Visual Studio Code, MAC OS X, OmniSharp server is
- Omnisharp in VS Code produces a lot of warnings ab
- Visual Studio Code command for “repeat last comman
- VSCode remove warnings from problems tab
- Configure a TypeScript project with common depende
- Visual Studio Code disabling Normal, Edit and Visu
- Vscode: error TS2307: Cannot find module 'vsco
- How to customize context menu in Visual Studio Cod
A similar issue re text/babel was raised here : https://github.com/Microsoft/vscode/issues/11781
What you have to do is find the default VSCode
html.json
file and make a small editOn Windows it will be something like this :
C:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\html\syntaxes\html.json
On Mac you have to find the VSCode app in your Applications folder and right click 'Show package contents' and nav to
/Contents/Resources/app/extensions/html/syntaxes/html.json
You should find a codeblock like this (search for
javascript
)just add paperscript to the regex like this
save the html.json and restart VSCode and you should be good to go.
I have raised a request at https://github.com/textmate/html.tmbundle/issues to have this included by default
Haven't found that the problem has yet been fixed and had to fix it myself manually as well.
Just wanted to bring up the way to fix this quickly on Windows 10 now that they use a user specific installation.
The directory you are searching for now is a little tougher to find. You are looking for
C:\Users\{user name here}\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\html\syntaxes\
and then the file is namedhtml.tmLanguage.json
instead. Otherwise the solution is still similar, search for the first instance of javascript and include paperscript in the regex for it. For me I found this long line.And changed it to this long line
I would recommend turning on line wrapping while reading through the document, and just add in
| paperscript
where possible. Microsoft VS Code doesn't seem to have added any support for this mimetype, but this is the quick and dirty way to solve it when you want to use the paperscript syntax in the HTML itself.Because your editor doesn't recognise the
text/paperscript
MIMEtype, it doesn't know what syntax highlighting to apply to it.To circumvent this, your best bet is to store your paperscript code in a separate file with the
.js
extension. Then your editor will automatically apply the correct JS syntax highlighting to it.index.html
index.js