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

Custom blocks break the highlighting #1088

Closed
3 tasks done
msaelices opened this issue Feb 11, 2019 · 6 comments
Closed
3 tasks done

Custom blocks break the highlighting #1088

msaelices opened this issue Feb 11, 2019 · 6 comments

Comments

@msaelices
Copy link

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: macOS
  • Vetur version: 0.15
  • VS Code version: 1.31.0

Problem

Custom blocks as <template-native> are considered as a template but the -native postfix break all the following blocks, like <script>, <style> etc.

screen shot 2019-02-11 at 12 51 28

Reproducible Case

Try this code:

<template>
  <div class="w-page">
    <div class="w-container">
      <img src="~/assets/logo.png" alt="logo" height="20%" width="20%">
      <HelloWorld :msg="msg"/>
    </div>
  </div>
</template>

<template-native>
  <Page>
    <ActionBar :title="navbarTitle"/>
    <GridLayout rows="auto, auto">
      <Button text="Home" @tap="goToHomePage" row="0"/>
      <Button text="About" @tap="goToAboutPage" row="1"/>
    </GridLayout>
  </Page>
</template-native>

<script>
  import HelloWorld from 'components/HelloWorld';
  export default {
    name: 'home',
    components: {
      HelloWorld
    },
    data() {
      return {
        msg: 'Mode=' + TNS_APP_MODE + ' and Platform=' + TNS_APP_PLATFORM,
      };
    },
  };
</script>

Even using the following Custom Block configuration, it still does not work:

    "vetur.grammar.customBlocks": {
      "template-native": "html"
    }
@DestinyHunter
Copy link

I have the same problem

Info

  • Platform: Win
  • Vetur version: 0.15.0
  • VS Code version: 1.31.1

co1u 0en1 ld a ho9rx
5x7o83w 9n3dpqa x wur

@octref
Copy link
Member

octref commented Feb 21, 2019

This:

{
  "vetur.grammar.customBlocks": {
    "docs": "md",
    "i18n": "json",
    "config": "json",
    "template-native": "html"
  }
}

Should fixe the highlighting now:

image

@octref octref closed this as completed in 24f04a0 Feb 21, 2019
@DestinyHunter
Copy link

Upgrading to the latest version still doesn't work. The configuration hasn't changed
image
image

@DestinyHunter
Copy link

default is ok
image

@p-kuen
Copy link
Contributor

p-kuen commented Feb 21, 2019

I will look for this problem, but it should be fixed. Did you regenerate the custom blocks using the vetur generate grammar command?

@DestinyHunter
Copy link

Sorry. You're right

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

4 participants