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

Attribute values being wrapped in parentheses while typing #2182

Closed
kleinfreund opened this issue Dec 8, 2022 · 5 comments
Closed

Attribute values being wrapped in parentheses while typing #2182

kleinfreund opened this issue Dec 8, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@kleinfreund
Copy link

Recently, Volar started to wrap some parts of attribute values in parentheses and I don’t recall a situation in which this was appropriate.

In the following examples, I expect no transformations to happen, especially not while I’m typing.

Example 1

Place the cursor after the i in (value, i), type x.

<template>
  <p
    v-for="(value, i) in {}"
    :key="i"
  >
    Test
  </p>
</template>

Result:

<template>
  <p
    v-for="((value, ix)) in {}"
    :key="i"
  >
    Test
  </p>
</template>

Example 2

Place the cursor after the > in "3 >", type 1.

<template>
  <p v-if="3 >">
    Test
  </p>
</template>

Result:

<template>
  <p v-if="(3 >1)">
    Test
  </p>
</template>
@sampullman
Copy link

I experience this as well, and it is resolved by reverting the plugin version to 1.0.9

@yooouuri
Copy link

yooouuri commented Dec 8, 2022

The wrapping also happens to me, it’s kinda annoying..

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Dec 8, 2022
@rchl
Copy link
Collaborator

rchl commented Dec 8, 2022

@johnsoncodehk it seems like the original issue was a vscode-specific syntax issue so maybe those workarounds should specifically target vscode.

@johnsoncodehk
Copy link
Member

@rchl Yes, I will make it default disabled to other IDEs. Do you plan to implement Auto Insertion for https://github.com/sublimelsp/LSP-volar?

@rchl
Copy link
Collaborator

rchl commented Dec 8, 2022

Probably not anytime soon since ST doesn't make it easy. Just have been thinking about other editors that would likely not need those workarounds.

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

5 participants