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/LICENSE
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
- `chmod +x` before try starting server.

View file

@ -350,15 +350,13 @@
<collections>
<!-- Tags -->
<collection name="tags">
<!-- Script -->
<scope name="html.embedded.script" spell-check="false" lookup="documentation">
<!-- Typescript -->
<scope name="html.embedded.block.script" spell-check="false" lookup="documentation">
<starts-with>
<expression>(?=&lt;(?i:script)\b)</expression>
<expression>(?=&lt;(?i:script)\b)(?=[^&gt;]*lang=('ts'|\"ts\"))(?![^/&gt;]*/&gt;\s*$)</expression>
</starts-with>
<ends-with>
<expression>(?=&lt;/(?i:script)\b)</expression>
</ends-with>
<subscopes>
<ends-with />
<subscopes anchored="true" skip-whitespace="false">
<scope name="html.tag.script.open">
<symbol type="tag-script">
<display-name>
@ -377,10 +375,54 @@
<expression>/?&gt;</expression>
</ends-with>
<subscopes>
<include syntax="self" collection="attributes" />
<include syntax="html" collection="attributes" />
</subscopes>
</scope>
<scope name="html.embedded.script.content">
<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="typescript">
<cut-off>
<expression>(?=&lt;/(?i:script)\b)</expression>
</cut-off>
</subsyntax>
</scope>
</subscopes>
</scope>
<!-- Javascript -->
<scope name="html.embedded.block.script" spell-check="false" lookup="documentation">
<starts-with>
<expression>(?=&lt;(?i:script)\b)</expression>
</starts-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>
@ -389,7 +431,7 @@
</ends-with>
<subsyntax name="javascript">
<cut-off>
<expression>(?=&lt;/(?i:script|head|body|div)\b)</expression>
<expression>(?=&lt;/(?i:script)\b)</expression>
</cut-off>
</subsyntax>
</scope>

View file

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