Visual Studio Code: Paperscript
up vote
0
down vote
favorite
(sorry for my english skills) Did you know any ext or something to color paperscript code?
paperscript off colors example
visual-studio-code paperjs
add a comment |
up vote
0
down vote
favorite
(sorry for my english skills) Did you know any ext or something to color paperscript code?
paperscript off colors example
visual-studio-code paperjs
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
(sorry for my english skills) Did you know any ext or something to color paperscript code?
paperscript off colors example
visual-studio-code paperjs
(sorry for my english skills) Did you know any ext or something to color paperscript code?
paperscript off colors example
visual-studio-code paperjs
visual-studio-code paperjs
asked May 30 '17 at 8:15
maczlord
33
33
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
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
<script type="text/paperscript" canvas="myCanvas" src="index.js"></script>
index.js
// exactly the same code you had inline before
for (var x = 0; x < 1000; x += 100) {
for (var y = 0; y < 1000; y += 100) {
var myCircle = new Path.Circle(new Point(x, y), 10);
myCircle.fillColor = 'purple';
}
}
add a comment |
up vote
3
down vote
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 edit
On Windows it will be something like this : C:Program Files (x86)Microsoft VS Coderesourcesappextensionshtmlsyntaxeshtml.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)
{
"begin": "\G",
"end": "(?i:(?=/?>|type(?=[\s=])(?!\s*=\s*('|"|)(text/(javascript|ecmascript|babel)|application/((x-)?javascript|ecmascript|babel)|module)[\s"'>])))",
"name": "meta.tag.metadata.script.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},just add paperscript to the regex like this
{
"begin": "\G",
"end": "(?i:(?=/?>|type(?=[\s=])(?!\s*=\s*('|"|)(text/(javascript|ecmascript|babel|paperscript)|application/((x-)?javascript|ecmascript|babel|paperscript)|module)[\s"'>])))",
"name": "meta.tag.metadata.script.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},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
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
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
<script type="text/paperscript" canvas="myCanvas" src="index.js"></script>
index.js
// exactly the same code you had inline before
for (var x = 0; x < 1000; x += 100) {
for (var y = 0; y < 1000; y += 100) {
var myCircle = new Path.Circle(new Point(x, y), 10);
myCircle.fillColor = 'purple';
}
}
add a comment |
up vote
2
down vote
accepted
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
<script type="text/paperscript" canvas="myCanvas" src="index.js"></script>
index.js
// exactly the same code you had inline before
for (var x = 0; x < 1000; x += 100) {
for (var y = 0; y < 1000; y += 100) {
var myCircle = new Path.Circle(new Point(x, y), 10);
myCircle.fillColor = 'purple';
}
}
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
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
<script type="text/paperscript" canvas="myCanvas" src="index.js"></script>
index.js
// exactly the same code you had inline before
for (var x = 0; x < 1000; x += 100) {
for (var y = 0; y < 1000; y += 100) {
var myCircle = new Path.Circle(new Point(x, y), 10);
myCircle.fillColor = 'purple';
}
}
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
<script type="text/paperscript" canvas="myCanvas" src="index.js"></script>
index.js
// exactly the same code you had inline before
for (var x = 0; x < 1000; x += 100) {
for (var y = 0; y < 1000; y += 100) {
var myCircle = new Path.Circle(new Point(x, y), 10);
myCircle.fillColor = 'purple';
}
}
edited Jun 21 '17 at 15:17
answered Jun 21 '17 at 15:11
Aron
2,6772827
2,6772827
add a comment |
add a comment |
up vote
3
down vote
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 edit
On Windows it will be something like this : C:Program Files (x86)Microsoft VS Coderesourcesappextensionshtmlsyntaxeshtml.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)
{
"begin": "\G",
"end": "(?i:(?=/?>|type(?=[\s=])(?!\s*=\s*('|"|)(text/(javascript|ecmascript|babel)|application/((x-)?javascript|ecmascript|babel)|module)[\s"'>])))",
"name": "meta.tag.metadata.script.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},just add paperscript to the regex like this
{
"begin": "\G",
"end": "(?i:(?=/?>|type(?=[\s=])(?!\s*=\s*('|"|)(text/(javascript|ecmascript|babel|paperscript)|application/((x-)?javascript|ecmascript|babel|paperscript)|module)[\s"'>])))",
"name": "meta.tag.metadata.script.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},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
add a comment |
up vote
3
down vote
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 edit
On Windows it will be something like this : C:Program Files (x86)Microsoft VS Coderesourcesappextensionshtmlsyntaxeshtml.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)
{
"begin": "\G",
"end": "(?i:(?=/?>|type(?=[\s=])(?!\s*=\s*('|"|)(text/(javascript|ecmascript|babel)|application/((x-)?javascript|ecmascript|babel)|module)[\s"'>])))",
"name": "meta.tag.metadata.script.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},just add paperscript to the regex like this
{
"begin": "\G",
"end": "(?i:(?=/?>|type(?=[\s=])(?!\s*=\s*('|"|)(text/(javascript|ecmascript|babel|paperscript)|application/((x-)?javascript|ecmascript|babel|paperscript)|module)[\s"'>])))",
"name": "meta.tag.metadata.script.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},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
add a comment |
up vote
3
down vote
up vote
3
down vote
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 edit
On Windows it will be something like this : C:Program Files (x86)Microsoft VS Coderesourcesappextensionshtmlsyntaxeshtml.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)
{
"begin": "\G",
"end": "(?i:(?=/?>|type(?=[\s=])(?!\s*=\s*('|"|)(text/(javascript|ecmascript|babel)|application/((x-)?javascript|ecmascript|babel)|module)[\s"'>])))",
"name": "meta.tag.metadata.script.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},just add paperscript to the regex like this
{
"begin": "\G",
"end": "(?i:(?=/?>|type(?=[\s=])(?!\s*=\s*('|"|)(text/(javascript|ecmascript|babel|paperscript)|application/((x-)?javascript|ecmascript|babel|paperscript)|module)[\s"'>])))",
"name": "meta.tag.metadata.script.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},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
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 edit
On Windows it will be something like this : C:Program Files (x86)Microsoft VS Coderesourcesappextensionshtmlsyntaxeshtml.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)
{
"begin": "\G",
"end": "(?i:(?=/?>|type(?=[\s=])(?!\s*=\s*('|"|)(text/(javascript|ecmascript|babel)|application/((x-)?javascript|ecmascript|babel)|module)[\s"'>])))",
"name": "meta.tag.metadata.script.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},just add paperscript to the regex like this
{
"begin": "\G",
"end": "(?i:(?=/?>|type(?=[\s=])(?!\s*=\s*('|"|)(text/(javascript|ecmascript|babel|paperscript)|application/((x-)?javascript|ecmascript|babel|paperscript)|module)[\s"'>])))",
"name": "meta.tag.metadata.script.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},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
{
"begin": "\G",
"end": "(?i:(?=/?>|type(?=[\s=])(?!\s*=\s*('|"|)(text/(javascript|ecmascript|babel)|application/((x-)?javascript|ecmascript|babel)|module)[\s"'>])))",
"name": "meta.tag.metadata.script.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},{
"begin": "\G",
"end": "(?i:(?=/?>|type(?=[\s=])(?!\s*=\s*('|"|)(text/(javascript|ecmascript|babel)|application/((x-)?javascript|ecmascript|babel)|module)[\s"'>])))",
"name": "meta.tag.metadata.script.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},{
"begin": "\G",
"end": "(?i:(?=/?>|type(?=[\s=])(?!\s*=\s*('|"|)(text/(javascript|ecmascript|babel|paperscript)|application/((x-)?javascript|ecmascript|babel|paperscript)|module)[\s"'>])))",
"name": "meta.tag.metadata.script.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},{
"begin": "\G",
"end": "(?i:(?=/?>|type(?=[\s=])(?!\s*=\s*('|"|)(text/(javascript|ecmascript|babel|paperscript)|application/((x-)?javascript|ecmascript|babel|paperscript)|module)[\s"'>])))",
"name": "meta.tag.metadata.script.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},answered Sep 20 '17 at 11:57
Perry Dyball
312
312
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44256968%2fvisual-studio-code-paperscript%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown