-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Description
As the title states, Vue syntax highlighting is broken. I first encountered this problem when there was no ~/.config/micro/syntax, so the editor was using the default syntax file.
What I've tried
- Installed
vue.yaml(the one from the repository'smicro/runtime/syntax) into~/.config/micro/syntax.- Result: Opening any
.vuefile raisesError parsing syntax file vue: interface conversion: interface {} is nil, not []interface {}twice. After the file finally opens, no syntax highlighting is applied.
- Result: Opening any
- Created my own
vue.yaml(see Additional Information).- Result: The
- includerule does not work as expected: for example,import { ref } from "vue"is not highlighted, even though other lines in the same<script>block are. In plain.jsfiles, there is no such behavior. A similar issue appears in the<template>block, while the<style>block is highlighted correctly. A screenshot is provided in Additional Information.
- Result: The
Environment
- OS: macOS Sequoia 15.0
- Terminal emulator: Alacritty
- Micro version: 2.0.14
- Shell: zsh
Additional information
- Syntax highlighting with no custom
vue.yaml.
- Contents of my custom
vue.yaml.
filetype: vue
detect:
filename: "\\.vue$"
rules:
- default:
start: "<script.*?>"
end: "</script>"
rules:
- include: "javascript"
- default:
start: "<template>"
end: "</template>"
rules:
- include: "html"
- default:
start: "<style.*?>"
end: "</style>"
rules:
- include: "css"
- Syntax highlighting with the custom
vue.yaml.
4. Vue code snippet used above — may be useful for quick reproduction.
<script setup>
import { ref } from "vue";
const count = ref(0);
</script>
<template>
<p>{{ count }}</p>
<button @click="count++">Increment</button>
</template>
<style>
html, body {
width: 100%;
height: 100%;
}
body {
font-family: system-ui;
font-size: 2rem;
}
#app {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
</style>
Metadata
Metadata
Assignees
Labels
No labels