coc-extensions / coc-svelte

svelte support for (Neo)Vim
MIT License
179 stars 24 forks source link

Support the svelte-preprocess template tags + pug/other html preprocessors #35

Open srcrip opened 3 years ago

srcrip commented 3 years ago

This kinda thing is supported in svelte-preprocess:

<template lang="pug">
  main
    h2 Title
    p lorem ipsum
</template>

It currently works in VSCode. But unfortunately not in this extension. Any idea how to make it work?

srcrip commented 3 years ago

If anyones curious, I guess the piece I was missing was just enabling pug with: https://github.com/leafOfTree/vim-svelte-plugin

I'm still having trouble getting it to play nice with eslint though.

srcrip commented 3 years ago

Actually I'm having one other problem directly related to the lang server: I get TS 2304 errors in this scenario:

<template lang="pug">
  main
    h1 Trillium
    section
      h2 Lobby
      pre { lobbyUsers }
      +each('lobbyUsers as user')
        li { user } // <--------------- [ts 2304] [E] Cannot find name 'user'.
</template>

Anyone know how to stop this?

davidroeca commented 3 years ago

@sevensidedmarble there are a number of related issues that are likely the cause here. Unfortunately, they are upstream so should be taken to the maintainers of the other repos. Once the fixes are made there, comment back here if updates that resolve the issue have been made and need to be brought back here

https://github.com/sveltejs/language-tools/issues/83 https://github.com/sveltejs/language-tools/issues/106 https://github.com/sveltejs/svelte-preprocess/issues/207