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

Volar/Vue: how to get autocompletions in javascript, HTML & CSS in vue files? #4446

Closed
2 of 3 tasks
pedroprieto opened this issue Apr 29, 2024 · 2 comments
Closed
2 of 3 tasks
Labels

Comments

@pedroprieto
Copy link

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

I am unable to get completions in Vue files both in HTML/CSS sections (emmet) and <script> sections. It seems that when I get one working, the other stops.

I have tried both eglot and lsp-mode. In eglot, I am able to get emmet completions from vue language tools, but no javascript (maybe because eglot does not support multiple servers?); in lsp-mode, I get javascript working, including embedded javascript in Vue template section, but no emmet completions:

imagen

imagen

I have tried with multiple major modes: vue-mode, tree-sitter and web-mode, with no luck.

I suspect that it is related to how those modes tell the lsp server its languageid, but I am not sure. Is there any kind of config that I am missing?

Steps to reproduce

Just open a .vue file and run lsp-mode.

Expected behavior

Emacs should show emmet completions in <template> and <style> sections inside .vue files.

Which Language Server did you use?

lsp-volar

OS

Linux

Error callstack

No response

Anything else?

No response

@sdvcrx
Copy link
Contributor

sdvcrx commented May 10, 2024

Please try:

(setq lsp-vetur-emmet "inMarkupAndStylesheetFilesOnly")

lsp-vetur disabled Emmet suggestions by default:

@pedroprieto
Copy link
Author

Ah, ok. I will try it. Thanks!!

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

No branches or pull requests

2 participants