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

Enable coc-html for other filetypes #8

Closed
AdrienLemaire opened this issue Feb 10, 2020 · 4 comments
Closed

Enable coc-html for other filetypes #8

AdrienLemaire opened this issue Feb 10, 2020 · 4 comments

Comments

@AdrienLemaire
Copy link

AdrienLemaire commented Feb 10, 2020

Related: #4, #5

I would like the coc-html ipc to be started on .html files with filetype=htmldjango.

Expected:

  "html.filetypes": [
    "htmldjango",
    "html"
  ],

would start coc-html on files with filetype = html or htmldjango

Currently:
Only files with filetype=html are started.

let g:coc_filetype_map = {
  \ 'htmldjango': 'html',
  \ }

is not a proper fix, because formatting an htmldjango file will ignore django template tags and format as if it was a regular html file.

Other plugins, like coc-tailwindcss, behave nicely.
I couldn't figure out how coc plugins are getting started based on the filetype, so do not know a proper fix for this issue.

@lippirk
Copy link

lippirk commented Apr 16, 2020

i had a similar issue with .hbs files, and fixed it by adding the following to my init.vim

autocmd BufEnter *.hbs :set ft=html

i couldn't get it to work with set ft=hbs, adding hbs to the coc_filetype_map, and also adding hbs to the filetypes in coc-settings.json

@ryanlinnane
Copy link

Same problem as @lippirk can we reopen this @chemzqm ?

@jorgeav527
Copy link

same issue here and for that reason coc-snippets can't load htmldjango.snippets @chemzqm I add all the config above witch @AdrienLemaire mentioned, update NPM, adding coc-html config, g:coc_filetype_map. others suggestions pls

@zatloeri
Copy link

zatloeri commented Jan 7, 2021

I am having the same problem.
Cannot make twig files work using

let g:coc_filetype_map = {
  \ ...
  \ }

Only autocmd BufEnter *.html.twig :set ft=html works

Am I doing something wrong, or is this a problem on the lib side?

@chemzqm chemzqm reopened this Jan 7, 2021
@chemzqm chemzqm closed this as completed in 19364e0 Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants