reddit / emacs

Using Emacs with Svelte-mode lsp-mode and web-mode

Ok_Mouse_8756 · 2022-01-31 06:36
I've found a great way to get the best of all three of theses modes in emacs, I'm just not too sure what the "engines" are in web-mode. It says svelte is one of them, but the documentation doesn't include svelte. I think this is the correct way, but if anyone knows better please let me know. Basically I'm just worried I'm miss using or configuring something. ;; svelte support (add-to-list 'auto-mode-alist '("\\.svelte\\'" . web-mode)) (setq web-mode-engines-alist '(("svelte" . "\\.svelte\\'"))) (i have `(web-mode . lsp-deferred)` in my lsp mode setup)
yyoncho · 2022-01-31 20:14
What happens when you do M-x lsp?
Ok_Mouse_8756 · 2022-02-01 01:48
It says svelte lsp connected. I think I figured it out. I was just getting confused. You need both sexps to get svelte full support in web mode. one to activate web mode with svelte files, and one to make web mode aware of the svelte engine.