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

Problem with svelte and deoplete #39

Closed
daliusd opened this issue Jul 30, 2019 · 6 comments

Comments

@daliusd
Copy link

commented Jul 30, 2019

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>'},
            \ ]

This helps with javascript autocompletion but css autocompletion does not work.

Adding this helps with css autocomplete but I think this shouldn't be necessary:

autocmd FileType svelte setlocal omnifunc=csscomplete#CompleteCSS

Any ideas what's wrong?

My .vimrc can be found here https://github.com/daliusd/cfg/blob/master/.vimrc if it is necessary.

@Shougo

This comment has been minimized.

Copy link
Owner

commented Jul 30, 2019

You should read deoplete documentation and understand features.

call deoplete#custom#source('omni', 'functions', {
\ 'css': ['csscomplete#CompleteCSS']
\})

deoplete is very smart if you know the features.

@Shougo Shougo closed this Jul 30, 2019

@daliusd

This comment has been minimized.

Copy link
Author

commented Jul 31, 2019

Shougo, I'm happy that there are two ways how to say to deoplete where to look for css omnifunc but my concern is different. The problem is that when I open css file I get omnifunc=csscomplete#CompleteCSS automatically and deoplete uses that. That's awesome. Now when I use context_filtype.vim for file that has JS, CSS and HTML/Svelte in one file then CSS autocompletion is not working out-of-the box and I need to do something about that (mine or your solution). I'm pretty sure that .vue files have the same problem.

I can live with current workarounds but IMHO that shouldn't be requirement for CSS.

I think this is the same problem as here with CSS: Shougo/deoplete.nvim#424

@daliusd

This comment has been minimized.

Copy link
Author

commented Jul 31, 2019

BTW, your proposal does not seem to be necessary or does not seem to change anything. I must note that autocomplete actually works but only partially and omni completions are not working. Here is how autocomplete looks like with my workaround:

1

Omni completions are shown with [O] and there are other autocompletions. With my workaround I can even get potential values:

2

Your proposal does not enable omnifunc ([O]) autocompletions.

@Shougo

This comment has been minimized.

Copy link
Owner

commented Jul 31, 2019

call deoplete#custom#var('omni', 'functions', {
\ 'css': ['csscomplete#CompleteCSS']
\})

This is the correct.

@Shougo

This comment has been minimized.

Copy link
Owner

commented Jul 31, 2019

And please use the latest version of deoplete.

@daliusd

This comment has been minimized.

Copy link
Author

commented Jul 31, 2019

Thanks for fixing this. You are awesome!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.