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

PUG + TS syntax highlighting breaks inside v-for #1154

Open
backbone87 opened this issue Mar 17, 2019 · 3 comments
Open

PUG + TS syntax highlighting breaks inside v-for #1154

backbone87 opened this issue Mar 17, 2019 · 3 comments

Comments

@backbone87
Copy link

Info

  • Platform: Win10
  • Vetur version: 0.16.2
  • VS Code version: 1.32

Problem

Using pug + typescript breaks syntax highlighting in vue files, when using a TS reserved name inside v-for.

Reproducible Case

<template lang="pug">
  ul
    //- syntax highlighting breaks within this line, until eof
    li(v-for="type in types") {{ type }}
</template>

<script lang="ts">
export default {
  data() {
    return { types: ['a', 'b'] };
  },
};
</script>

using v-for="(type) in types" avoids it.

@octref
Copy link
Member

octref commented Mar 17, 2019

This is the same problem as using type in HTML interpolation.

The proper fix would be to strip TS-specific keyword constructs from https://github.com/Microsoft/TypeScript-TmLanguage for a JS grammar, but that would need to go into https://github.com/Microsoft/vscode/tree/master/extensions/javascript. I don't currently have time for it.

@Patcher56 You might be interested.

@backbone87
Copy link
Author

i rather prefer no syntax highlighting for interpolations insteadof broken highlighting, and i guess i am not the only one. maybe add a setting to opt out of interpolation highlighting.

@p-kuen
Copy link
Contributor

p-kuen commented Mar 18, 2019

I also ran into this problem. I just used another keyword instead of ‚type‘ as it is a reserved keyword.

I also currently do not know how I would fix that. I can look if I could create a setting for deactivating highlighting for interpolations in pug.

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

No branches or pull requests

3 participants