Closed andrewheartsxd closed 2 years ago
While looking into this, I noticed that the coc-nvim install instructions have changed since the minimal-config.vim file was made.
One thing that lead me to check this, was that I kept getting:
[coc.nvim] build/index.js not found, please install depnedencies...
Updating to have (at the time of writing, latest):
Plug 'neoclide/coc.nvim', {'branch': 'release'}
What I did to get things working:
rm -rf ~/.local/share/nvim/plugged/coc-ember/
rm -rf ~/.local/share/nvim/plugged/coc.nvim/
then, in neovim, my command is (with updated config, which is pushed at the time of me clicking the "comment" button on this comment):
nvim ./app/templates/about.hbs -u ../../NullVoxPopuli/coc-ember/docs/minimal-config.vim
```vim
:PlugClean
# quit, re-open
:PlugUpdate
# quit, re-open
:CocUpdate
and... success!!
(I have completions in the template)
Thanks for taking a look at this. I updated my minimal-config.vim
to match https://github.com/NullVoxPopuli/coc-ember/commit/0607d3671c5de094c035e665443b8fd5caf7a33a and followed the rest of the steps in your comment. Unfortunately, I still get no autocompletion. It still seems like the Ember Language Server doesn't even start in .hbs
files, according to :CocInfo
.
I'm also on MacOS, I wonder if this is somehow related to https://github.com/NullVoxPopuli/coc-ember/issues/333 ☹️
hm, yeah -- I'm on linux. :thinking:
@lifeart or @alexlafroscia or @JimSchofield, do any of you have thoughts?
oh! @andrewheartsxd I just had a thought -- how are your .hbs
files identified?
for me, the filetype is handlebars
.
in your screenshots, idk if the filetype is printed anywhere :thinking:
That seems to be the issue!
Running :set filetype?
prints out html.handlebars
.
When I manually :set filetype=handlebars
, autocomplete starts working!
This is interesting to me because I believe the vim-ember
syntax plugin actually sets the filetype to html.handlebars
?: https://github.com/joukevandermaas/vim-ember-hbs/blob/master/ftdetect/handlebars.vim
hmm, html.handlebars
should be supported -- I wonder if coc maybe doesn't support languages with .
in the name? I'll have to look in to that
Gonna close for now. The filetype thing should maybe be a separate issue
@NullVoxPopuli there is a few places where we rely on document type === 'handlebars' in LS,
hmmm -- gotchya -- so we'll need to expand that to include the alternate types -- as well as gjs/gts (plus template extraction)?
@NullVoxPopuli html.handlebars
is not part of LSP protocol https://microsoft.github.io/language-server-protocol/specification
Since gjs
, gts
types does not agreed - I don't think we need to support html.handlebars
name, because it's leads us to bunch of various cases to handle.
yeah, what's even funner is that we don't actually use handlebars
either. "ember templates" are their own thing
Since gjs, gts types does not agreed -
how do you mean?
@NullVoxPopuli there is no agreed identifier for extensions
well, obviously I'm partial to (neo)vim's dot-separated identifies :sweat_smile:
typescript.glimmer javascript.glimmer
If anyone else finds their way in here looking for a solution, this config solved it for me:
let g:coc_filetype_map = {
\ 'html.handlebars': 'handlebars',
\ }
First off, thanks for the work on this extension, I really want to use it! 😄
I am using the demo project cloned from:
https://github.com/ember-learn/super-rentals
Here are the steps I'm taking and the corresponding output:
cd ~/Development/super-rentals
and start nvim:nvim . -u ../coc-ember/docs/minimal-config.vim
Output of
PlugInstall
:Open a template file
:e ~/Development/super-rentals/app/templates/application.hbs
and run:CocInfo
:So one thing that jumped out to me is that
coc-ember
isn't actually running. At this point, if I run:CocList extensions
(coc-ember
is outside the visible list):If I then open a
.js
file (:e app/router.js
) and run:CocInfo
, I can see the Ember Language Server is running :Autocomplete works in
router.js
:Switching back to the template however, no Ember-related autocomplete pops up:
I believe I've followed the setup instructions in the README. Is there something else I'm missing?