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

Formatting edit range incorrect edge case #1814

Closed
johnsoncodehk opened this issue Sep 4, 2022 · 0 comments
Closed

Formatting edit range incorrect edge case #1814

johnsoncodehk opened this issue Sep 4, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@johnsoncodehk
Copy link
Member

This problem occurs because the i18n custom block offset is not changed.

Reproduce code:

<template>
  <img alt="Vue logo" src="./assets/logo.png" />
  <HelloWorld msg="Hello Vue 3 + TypeScript + Vite" />
  {{ $t /* $t(key: "hello"): void */ }}
</template>

<i18n lang="json">
{
  "en": {
    "hello": "hello world!"
  },
  "ja": {
    "hello": "こんにちは、世界!"
  }
}
</i18n>
  1. Do html -> pug convert
  2. Do pug -> html convert
  3. Format document

Expected result

<template>
  <img alt="Vue logo" src="./assets/logo.png" />
  <HelloWorld msg="Hello Vue 3 + TypeScript + Vite"></HelloWorld>
  {{ $t /* $t(key: "hello"): void */ }}
</template>

<i18n lang="json">
{
  "en": {
    "hello": "hello world!"
  },
  "ja": {
    "hello": "こんにちは、世界!"
  }
}
</i18n>

Actually result

<template>
  <img alt="Vue logo" src="./assets/logo.png" />
  <HelloWorld msg="Hello Vue 3 + TypeScript + Vite"></HelloWorld>
  {{ $t /* $t(key: "hello"): void */ }}
</template>

<i18n lang="json">
{
  "en": {

{
  "en": {
    "hello": "hello world!"
  },
  "ja": {
    "hello": "こんにちは、世界!"
  }
}
@johnsoncodehk johnsoncodehk added the bug Something isn't working label Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant