leafOfTree / svelte-mode

Emacs major mode for Svelte.
GNU Lesser General Public License v3.0
83 stars 5 forks source link

Enable autocompletion in svelte files in spacemacs #6

Closed ImmanuelSamuel closed 3 years ago

ImmanuelSamuel commented 3 years ago

Is there a way to enable auto-completion in svelte files kind of like in vue files where auto-completion works for js, html and css.

I have auto-complete layer initialized in the .spacemacs file.

leafOfTree commented 3 years ago

Thanks. That's a good idea. I'll figure out how to enable auto-completion in svelte files in spacemacs.

leafOfTree commented 3 years ago

Hi, I tried m-x company-mode and it appeared to work for JavaScript, HTML and CSS in svelte files. Then I restarted emacs. Unfortunately, something accidentally went wrong. The company-mode was missing and all packages installed after that complained wrong type argument: stringp, <package-name>. I'm still working on it. Do you know what happened?

Never mind. Actually, it seems to be caused by multiple versions of emacs in my env.

leafOfTree commented 3 years ago

Hi, it has been a little long. I've added auto-completion (company-mode) support in spacemacs based on the Vue layer https://github.com/syl20bnr/spacemacs/blob/develop/layers/%2Bframeworks/vue/funcs.el. After the update and opening any .svelte file, it will auto-enable company-mode for script, style and template.

leafOfTree commented 3 years ago

I'm closing it. Feel free to reopen it if any questions.