This commit is contained in:
Pierre Minik Lynge 2021-01-28 18:29:38 -03:00
parent f55a5ca26a
commit d19b93d9f0
4 changed files with 91 additions and 44 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,50 +350,92 @@
<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"> </scope>
<auto-close string="&lt;/" completion="${name}&gt;" />
</context> <!-- Javascript -->
</symbol> <scope name="html.embedded.block.script" spell-check="false" lookup="documentation">
<starts-with> <starts-with>
<expression>&lt;((?i:script))</expression> <expression>(?=&lt;(?i:script)\b)</expression>
<capture number="1" name="html.tag.name" /> </starts-with>
</starts-with> <ends-with />
<ends-with> <subscopes anchored="true" skip-whitespace="false">
<expression>/?&gt;</expression> <scope name="html.tag.script.open">
</ends-with> <symbol type="tag-script">
<subscopes> <display-name>
<include syntax="self" collection="attributes" /> <component variable="name" />
</subscopes> <component selector="html.tag.attribute.value.link" prepend=" " />
</scope> </display-name>
<scope name="html.embedded.script.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:script)\b)</expression> <expression>&lt;((?i:script))</expression>
</ends-with> <capture number="1" name="html.tag.name" />
<subsyntax name="javascript"> </starts-with>
<cut-off> <ends-with>
<expression>(?=&lt;/(?i:script|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.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> </scope>
<!-- Style --> <!-- Style -->

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"
} }