Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

instanceof Class breaks syntax highlighting in template #2099

Closed
TheNoim opened this issue Nov 7, 2022 · 6 comments
Closed

instanceof Class breaks syntax highlighting in template #2099

TheNoim opened this issue Nov 7, 2022 · 6 comments

Comments

@TheNoim
Copy link
Contributor

TheNoim commented Nov 7, 2022

If you use instanceof Class it breaks syntax highlighting after the Class.

Example:

image

Minimal reproduction:

<template>
  <div v-if="varA instanceof Test"></div>
</template>

<script setup lang="ts">
import { ref } from "vue";

class Test {}

const varA = ref(new Test());
</script>
@drsmile1001
Copy link

Is this fix @ 1.0.10? It seems still has problem here.
image

@johnsoncodehk
Copy link
Member

You need to wrap it to v-if="(xxx instandceof yyy)", in v1.0.10 it will automatically wrap.

@TheNoim
Copy link
Contributor Author

TheNoim commented Dec 1, 2022

You need to wrap it to v-if="(xxx instandceof yyy)", in v1.0.10 it will automatically wrap.

But why, this is totally fine and valid code?

@johnsoncodehk
Copy link
Member

This is VSCode bug, see #520 (comment)

@TheNoim
Copy link
Contributor Author

TheNoim commented Dec 1, 2022

But this will not play well with linters and formatters like prettier or eslint.

@johnsoncodehk
Copy link
Member

You should open an issue to VSCode. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants