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

template html attributes expand with $1 and cursor after quotes #5153

Closed
coffebar opened this issue Jan 30, 2025 · 3 comments
Closed

template html attributes expand with $1 and cursor after quotes #5153

coffebar opened this issue Jan 30, 2025 · 3 comments

Comments

@coffebar
Copy link

Vue - Official extension or vue-tsc version

@vue/language-server 2.2.0

VSCode version

NVIM v0.10.4

Vue version

3

TypeScript version

5.7.3

System Info

System:
    OS: Linux 6.6 Arch Linux
    CPU: (20) x64 Intel(R) Core(TM) i9-10900F CPU @ 2.80GHz
    Memory: 16.07 GB / 31.25 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 23.4.0 - /usr/bin/node
    Yarn: 1.22.22 - /usr/bin/yarn
    npm: 11.0.0 - /usr/bin/npm
    pnpm: 9.14.4 - ~/.node_modules/bin/pnpm

package.json dependencies

Steps to reproduce

configuration

local lsp_installed, lspconfig = pcall(require, "lspconfig")
if not lsp_installed then
  return
end

lspconfig.ts_ls.setup({
  filetypes = {
    "javascript",
    "typescript",
    "vue",
  },
  -- plugin for vue ts
  init_options = {
    plugins = {
      {
        name = "@vue/typescript-plugin",
        languages = { "vue" },
        location = vim.fn.expand("~/.local/share/pnpm/global/5/node_modules/@vue/language-server"),
      },
    },
  },
})
-- vue js from @vue/language-server
lspconfig.volar.setup({
  filetypes = { "vue" },
  init_options = {
    typescript = {
      tsdk = vim.fn.expand("~/.local/share/pnpm/global/5/node_modules/typescript/lib/"),
    },
  },
})

test.vue

<template>
    <div class|>
    </div>
</template>

When i use auto-completion to div (any) tag, for example "class" or "id", LSP expands cla.. to class="$1" and put cursor after closing "

What is expected?

I expect to expand cla.. intoclass="" with cursor inside the ""

What is actually happening?

Image

Link to minimal reproduction

No response

Any additional comments?

> pnpm -g list

/home/abc/.local/share/pnpm/global/5

dependencies:
@ansible/ansible-language-server 1.2.3  prettier 3.4.2
@johnnymorganz/stylua-bin 2.0.2         prettier-plugin-nginx 1.0.3
@prettier/plugin-php 0.22.4             prettier-plugin-sh 0.14.0
@shufo/prettier-plugin-blade 1.15.2     prettier-plugin-ssh-config 0.3.0
@vue/language-server 2.2.0              pyright 1.1.393
@vue/typescript-plugin 2.2.0            stylefmt 6.0.3
bash-language-server 5.4.3              tree-sitter-cli 0.24.7
emmet-ls 0.4.2                          typescript 5.7.3
eslint 9.19.0                           typescript-language-server 4.3.3
intelephense 1.12.6                     uglify-js 3.19.3
neovim 5.3.0                            vscode-langservers-extracted 4.10.0
@KazariEX
Copy link
Member

/cc @RayGuo-ergou

@RayGuo-ergou
Copy link
Contributor

Image

I cannot reproduce this, maybe caused by other plugins can you try with only lsp and see if this issue persist.

@coffebar
Copy link
Author

I noticed that emmet has same issue for me now.
emmet not using lsp, so this bug can't be related to LSP.
Sorry for not relevant issue

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