refactor(svelte): Remove duplicated queries

These injection queries are defined already in html_tags, remove them

Signed-off-by: Pham Huy Hoang <hoangtun0810@gmail.com>
This commit is contained in:
Lucario387 2023-01-02 10:47:46 +09:00 committed by Stephan Seitz
parent 6f4b9b190b
commit 28baed7698
2 changed files with 43 additions and 7 deletions

View file

@ -4,16 +4,13 @@
(style_element
(start_tag
(attribute
(attribute_name) @_attr
(quoted_attribute_value (attribute_value) @_lang)))
(raw_text) @scss)
(#eq? @_attr "lang")
(#any-of? @_lang "scss" "postcss" "less")
)
((attribute
(attribute_name) @_attr
(quoted_attribute_value (attribute_value) @css))
(#eq? @_attr "style"))
[
(raw_text_expr)
(raw_text_each)
@ -23,9 +20,9 @@
(script_element
(start_tag
(attribute
(attribute_name) @_attr
(quoted_attribute_value (attribute_value) @_lang)))
(raw_text) @typescript)
(#eq? @_attr "lang")
(#any-of? @_lang "ts" "typescript")
)
(comment) @comment

View file

@ -0,0 +1,39 @@
<script>
import Button from "./Button.svelte";
// ^ javascript
</script>
<script lang="ts">
const foo: number = 1
// ^ typescript
</script>
<style>
main {
font-family: sans-serif;
text-align: center;
/* ^ css
*/
}
</style>
<style lang="scss">
main {
font-family: sans-serif;
text-align: center;
&:hover {
// ^ scss
}
}
</style>
<main>
<h1>Test file</h1>
{#each someItems as someItem}
<!-- ^ javascript
-->
<div>{someItem}</div>
<!-- ^ javascript
-->
{/each}
<Button />
<button on:click={() => foo++}></button>
</main>