Shougo / context_filetype.vim

Context filetype library for Vim script
Other
160 stars 20 forks source link

javascript in html can't work #41

Closed yangxyo closed 4 years ago

yangxyo commented 4 years ago
if !exists('g:context_filetype#same_filetypes')
  let g:context_filetype#filetypes = {}
endif
let g:context_filetype#filetypes.svelte = [
\ {'filetype' :'javascript', 'start': '<script>', 'end': '</script>'},
\ {'filetype' :'css', 'start': '<style>', 'end': '</style>'},
\ ]
call deoplete#custom#var('omni', 'functions', {
\ 'css': ['csscomplete#CompleteCSS'],
\})

It let css-completion work, but javascript doesn't work with YCM, inside HTML.

Even with deoplete, comment out the YCM.

call deoplete#custom#option('omni_patterns', { 
\ 'javascript': '[^. *\t]\.\w*',
\ 'go': '[^. *\t]\.\w*',
\})

In .js it work. But in html it doesn't work too.

Shougo commented 4 years ago

You have not uploaded reproduce step. I will close it later.

Shougo commented 4 years ago

You should read other issues. https://github.com/Shougo/context_filetype.vim/issues/39#issuecomment-516734193 https://github.com/Shougo/context_filetype.vim/issues/38#issuecomment-466834409

Other people reports are better than yours.

Shougo commented 4 years ago

If you upload reproduce steps, I will reopen it.

yangxyo commented 4 years ago

Sorry, I don't expect you reply so soon, please, what is reproduce step?

yangxyo commented 4 years ago

work image work image nothing image

yangxyo commented 4 years ago

I may know the 'reproduce steps'. I have added following lines to my .vimrc:

if !exists('g:context_filetype#same_filetypes')
  let g:context_filetype#filetypes = {}
endif
let g:context_filetype#filetypes.svelte = [
\ {'filetype' :'javascript', 'start': '<script>', 'end': '</script>'},
\ {'filetype' :'css', 'start': '<style>', 'end': '</style>'},
\ ]
call deoplete#custom#var('omni', 'functions', {
\ 'css': ['csscomplete#CompleteCSS'],
\})

It lets css-completion work, but javascript doesn't work with YCM, inside HTML.

then to add following lines to my .vimrc:

call deoplete#custom#option('omni_patterns', { 
\ 'javascript': '[^. *\t]\.\w*',
\ 'go': '[^. *\t]\.\w*',
\})

In .js it work. But in html it doesn't work too.

Shougo commented 4 years ago

OK. I will check the issue.

yangxyo commented 4 years ago

Thanks.