Merge pull request #2 from pierreminik/main

v0.1.5: Restoring syntax fix for javascript and added typescript
This commit is contained in:
Shibo Lyu 2021-03-02 12:22:14 +08:00 committed by GitHub
commit 916d5a74fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 248 additions and 83 deletions

1
.gitignore vendored
View file

@ -4,3 +4,4 @@ SvelteNova.novaextension/README.md
SvelteNova.novaextension/CHANGELOG.md SvelteNova.novaextension/CHANGELOG.md
SvelteNova.novaextension/LICENSE SvelteNova.novaextension/LICENSE
SvelteNova.novaextension/Scripts/**/* SvelteNova.novaextension/Scripts/**/*
.DS_Store

View file

@ -1,3 +1,7 @@
# v0.1.5
- Fixed missing syntax highlighting for script tags (added by @pierreminik who copied updates from @tommasongr's [vue extension](https://github.com/tommasongr/nova-vue)).
# v0.1.4 # v0.1.4
- `chmod +x` before try starting server. - `chmod +x` before try starting server.

View file

@ -350,92 +350,252 @@
<collections> <collections>
<!-- Tags --> <!-- Tags -->
<collection name="tags"> <collection name="tags">
<!-- Script --> <!-- Typescript -->
<scope name="html.embedded.script" spell-check="false" lookup="documentation"> <scope name="html.embedded.block.script" spell-check="false" lookup="documentation">
<starts-with> <starts-with>
<expression>(?=&lt;(?i:script)\b)</expression> <expression>(?=&lt;(?i:script)\b)(?=[^&gt;]*lang=('ts'|\"ts\"))(?![^/&gt;]*/&gt;\s*$)</expression>
</starts-with> </starts-with>
<ends-with> <ends-with />
<subscopes anchored="true" skip-whitespace="false">
<scope name="html.tag.script.open">
<symbol type="tag-script">
<display-name>
<component variable="name" />
<component selector="html.tag.attribute.value.link" prepend=" " />
</display-name>
<context behavior="start" group-by-name="true">
<auto-close string="&lt;/" completion="${name}&gt;" />
</context>
</symbol>
<starts-with>
<expression>&lt;((?i:script))</expression>
<capture number="1" name="html.tag.name" />
</starts-with>
<ends-with>
<expression>/?&gt;</expression>
</ends-with>
<subscopes>
<include syntax="html" collection="attributes" />
</subscopes>
</scope>
<scope name="html.embedded.block.script.content">
<starts-with>
<expression>(?&lt;=&gt;)</expression>
</starts-with>
<ends-with>
<expression>(?=&lt;/(?i:script)\b)</expression> <expression>(?=&lt;/(?i:script)\b)</expression>
</ends-with> </ends-with>
<subscopes> <subsyntax name="typescript">
<scope name="html.tag.script.open"> <cut-off>
<symbol type="tag-script"> <expression>(?=&lt;/(?i:script)\b)</expression>
<display-name> </cut-off>
<component variable="name" /> </subsyntax>
<component selector="html.tag.attribute.value.link" prepend=" " /> </scope>
</display-name> </subscopes>
<context behavior="start" group-by-name="true">
<auto-close string="&lt;/" completion="${name}&gt;" />
</context>
</symbol>
<starts-with>
<expression>&lt;((?i:script))</expression>
<capture number="1" name="html.tag.name" />
</starts-with>
<ends-with>
<expression>/?&gt;</expression>
</ends-with>
<subscopes>
<include syntax="self" collection="attributes" />
</subscopes>
</scope>
<scope name="html.embedded.script.content">
<starts-with>
<expression>(?&lt;=&gt;)</expression>
</starts-with>
<ends-with>
<expression>(?=&lt;/(?i:script)\b)</expression>
</ends-with>
<subsyntax name="javascript">
<cut-off>
<expression>(?=&lt;/(?i:script|head|body|div)\b)</expression>
</cut-off>
</subsyntax>
</scope>
</subscopes>
</scope> </scope>
<!-- Style --> <!-- Javascript -->
<scope name="html.embedded.style" spell-check="false" lookup="documentation"> <scope name="html.embedded.block.script" spell-check="false" lookup="documentation">
<starts-with> <starts-with>
<expression>(?=&lt;(?i:style)\b)</expression> <expression>(?=&lt;(?i:script)\b)</expression>
</starts-with> </starts-with>
<ends-with> <ends-with />
<subscopes anchored="true" skip-whitespace="false">
<scope name="html.tag.script.open">
<symbol type="tag-script">
<display-name>
<component variable="name" />
<component selector="html.tag.attribute.value.link" prepend=" " />
</display-name>
<context behavior="start" group-by-name="true">
<auto-close string="&lt;/" completion="${name}&gt;" />
</context>
</symbol>
<starts-with>
<expression>&lt;((?i:script))</expression>
<capture number="1" name="html.tag.name" />
</starts-with>
<ends-with>
<expression>/?&gt;</expression>
</ends-with>
<subscopes>
<include syntax="html" collection="attributes" />
</subscopes>
</scope>
<scope name="html.embedded.block.script.content">
<starts-with>
<expression>(?&lt;=&gt;)</expression>
</starts-with>
<ends-with>
<expression>(?=&lt;/(?i:script)\b)</expression>
</ends-with>
<subsyntax name="javascript">
<cut-off>
<expression>(?=&lt;/(?i:script)\b)</expression>
</cut-off>
</subsyntax>
</scope>
</subscopes>
</scope>
<!-- SASS -->
<scope name="html.embedded.block.style" spell-check="false" lookup="documentation">
<starts-with>
<expression>(?=&lt;(?i:style)\b)(?=[^&gt;]*lang=('sass'|\"sass\"))(?![^/&gt;]*/&gt;\s*$)</expression>
</starts-with>
<ends-with />
<subscopes anchored="true" skip-whitespace="false">
<scope name="html.tag.style.open">
<symbol type="tag-style">
<context behavior="start" group-by-name="true">
<auto-close string="&lt;/" completion="${name}&gt;" />
</context>
</symbol>
<starts-with>
<expression>&lt;((?i:style))</expression>
<capture number="1" name="html.tag.name" />
</starts-with>
<ends-with>
<expression>/?&gt;</expression>
</ends-with>
<subscopes>
<include syntax="html" collection="attributes" />
</subscopes>
</scope>
<scope name="html.embedded.block.style.content">
<starts-with>
<expression>(?&lt;=&gt;)</expression>
</starts-with>
<ends-with>
<expression>(?=&lt;/(?i:style)\b)</expression> <expression>(?=&lt;/(?i:style)\b)</expression>
</ends-with> </ends-with>
<subscopes> <subsyntax name="sass">
<scope name="html.tag.style.open"> <cut-off>
<symbol type="tag-style"> <expression>(?=&lt;/(?i:style)\b)</expression>
<context behavior="start" group-by-name="true"> </cut-off>
<auto-close string="&lt;/" completion="${name}&gt;" /> </subsyntax>
</context> </scope>
</symbol> </subscopes>
<starts-with> </scope>
<expression>&lt;((?i:style))</expression>
<capture number="1" name="html.tag.name" /> <!-- SCSS -->
</starts-with> <scope name="html.embedded.block.style" spell-check="false" lookup="documentation">
<ends-with> <starts-with>
<expression>/?&gt;</expression> <expression>(?=&lt;(?i:style)\b)(?=[^&gt;]*lang=('scss'|\"scss\"))(?![^/&gt;]*/&gt;\s*$)</expression>
</ends-with> </starts-with>
<subscopes> <ends-with />
<include syntax="self" collection="attributes" /> <subscopes anchored="true" skip-whitespace="false">
</subscopes> <scope name="html.tag.style.open">
</scope> <symbol type="tag-style">
<scope name="html.embedded.style.content"> <context behavior="start" group-by-name="true">
<starts-with> <auto-close string="&lt;/" completion="${name}&gt;" />
<expression>(?&lt;=&gt;)</expression> </context>
</starts-with> </symbol>
<ends-with> <starts-with>
<expression>(?=&lt;/(?i:style)\b)</expression> <expression>&lt;((?i:style))</expression>
</ends-with> <capture number="1" name="html.tag.name" />
<subsyntax name="css"> </starts-with>
<cut-off> <ends-with>
<expression>(?=&lt;/(?i:style|head|body|div)\b)</expression> <expression>/?&gt;</expression>
</cut-off> </ends-with>
</subsyntax> <subscopes>
</scope> <include syntax="html" collection="attributes" />
</subscopes> </subscopes>
</scope>
<scope name="html.embedded.block.style.content">
<starts-with>
<expression>(?&lt;=&gt;)</expression>
</starts-with>
<ends-with>
<expression>(?=&lt;/(?i:style)\b)</expression>
</ends-with>
<subsyntax name="scss">
<cut-off>
<expression>(?=&lt;/(?i:style)\b)</expression>
</cut-off>
</subsyntax>
</scope>
</subscopes>
</scope>
<!-- LESS -->
<scope name="html.embedded.block.style" spell-check="false" lookup="documentation">
<starts-with>
<expression>(?=&lt;(?i:style)\b)(?=[^&gt;]*lang=('less'|\"less\"))(?![^/&gt;]*/&gt;\s*$)</expression>
</starts-with>
<ends-with />
<subscopes anchored="true" skip-whitespace="false">
<scope name="html.tag.style.open">
<symbol type="tag-style">
<context behavior="start" group-by-name="true">
<auto-close string="&lt;/" completion="${name}&gt;" />
</context>
</symbol>
<starts-with>
<expression>&lt;((?i:style))</expression>
<capture number="1" name="html.tag.name" />
</starts-with>
<ends-with>
<expression>/?&gt;</expression>
</ends-with>
<subscopes>
<include syntax="html" collection="attributes" />
</subscopes>
</scope>
<scope name="html.embedded.block.style.content">
<starts-with>
<expression>(?&lt;=&gt;)</expression>
</starts-with>
<ends-with>
<expression>(?=&lt;/(?i:style)\b)</expression>
</ends-with>
<subsyntax name="less">
<cut-off>
<expression>(?=&lt;/(?i:style)\b)</expression>
</cut-off>
</subsyntax>
</scope>
</subscopes>
</scope>
<!-- CSS -->
<scope name="html.embedded.block.style" spell-check="false" lookup="documentation">
<starts-with>
<expression>(?=&lt;(?i:style)\b)</expression>
</starts-with>
<ends-with />
<subscopes anchored="true" skip-whitespace="false">
<scope name="html.tag.style.open">
<symbol type="tag-style">
<context behavior="start" group-by-name="true">
<auto-close string="&lt;/" completion="${name}&gt;" />
</context>
</symbol>
<starts-with>
<expression>&lt;((?i:style))</expression>
<capture number="1" name="html.tag.name" />
</starts-with>
<ends-with>
<expression>/?&gt;</expression>
</ends-with>
<subscopes>
<include syntax="html" collection="attributes" />
</subscopes>
</scope>
<scope name="html.embedded.block.style.content">
<starts-with>
<expression>(?&lt;=&gt;)</expression>
</starts-with>
<ends-with>
<expression>(?=&lt;/(?i:style)\b)</expression>
</ends-with>
<subsyntax name="css">
<cut-off>
<expression>(?=&lt;/(?i:style)\b)</expression>
</cut-off>
</subsyntax>
</scope>
</subscopes>
</scope> </scope>
<!-- Closing Tags --> <!-- Closing Tags -->

View file

@ -1,6 +1,6 @@
{ {
"name": "sveltenova.novaextension", "name": "sveltenova.novaextension",
"version": "0.1.4", "version": "0.1.5",
"dependencies": { "dependencies": {
"svelte-language-server": "^0.10.147" "svelte-language-server": "^0.10.147"
} }