Incorrect syntax highlighting when using nullish coalescing in template
See original GitHub issue- I have searched through existing issues
- I have read through docs
- I have read FAQ
- I have tried restarting VS Code or running
Vetur: Restart VLS
Info
- Platform: Win10
- Vetur version: 0.33.1
- VS Code version: 1.55.1
Problem
When using nullish coalescing(??
) in template, syntax highlighting behaves unexpectedly:
While using ||
the highlighing is correct:
I don’t know why but this problem doesn’t happen on my macOS (with same VSCode extensions and settings).
Reproducible Case
Create a new .vue
file:
<template>
<div>
<span>
{{ aVariable ?? 3 }}
</span>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
props: {
aVariable: { type: Number, required: true },
},
});
</script>
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Incorrect syntax highlighting when using nullish coalescing in ...
Incorrect syntax highlighting when using nullish coalescing in template #2861 ... I have tried restarting VS Code or running Vetur: Restart VLS ...
Read more >VSCode syntax highlighting not working when using
Good afternoon! I'm working on react.js with typescript. Recently moved to a new computer and noticed ...
Read more >Binding syntax - Angular
You use data binding to specify things such as the source of an image, the state of a button, or data for a...
Read more >WebStorm 201.5616.21 Release Notes | Knowledge Base
Feature, WEB-43548, Vuex: support code completion for Vuex store symbols within ... Bug, WEB-43744, Incorrect type inference with nullish coalescing and ...
Read more >Angular 14 is Available Now! - eSketchers
For example, we can write invalid code with successful compilation. ... also display a warning for nullish coalescing operators (?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Similar happens when using typeof operator in a v-if condition
Using typeof
No typeof
I will close this issue. Thanks for your report. The
typeof
problem ☞ https://github.com/vuejs/vetur/issues/2709