-
Notifications
You must be signed in to change notification settings - Fork 7
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
Update ncm to ncm2 #15
Conversation
In order to get the routes completion working for ncm2, I had to make the capture() function available from anywhere, and I needed to call it with 2 arguments intead of 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking this on!
I wasn't sure the right way to handle this - add a whole new group of stuff for ncm2, or just update it.
Let's preserve the original ncm support, since the cost is low. But you can stick new autocommands in the same group (laravel_completion
).
Not sure where this instruction came from, but there are none, unfortunately. :/ |
That instruction came from |
Made the requesting changes, let me know if there's anything else! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good after these few formatting nitpicks.
I actually can't get it to work, but my autocompletion setup is perpetually broken in one way or another. As long as you've manually confirmed this works, I'm happy to merge it.
plugin/laravel.vim
Outdated
\ 'on_complete': 'laravel#completion#ncm2_routes', | ||
\ }) | ||
autocmd User Ncm2Plugin call ncm2#register_source({ | ||
\ 'name' : 'Laravel View', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\ 'name' : 'Laravel View', | |
\ 'name': 'Laravel View', |
plugin/laravel.vim
Outdated
" Set up ncm2 sources | ||
" :help ncm2#register_source-example | ||
autocmd User Ncm2Plugin call ncm2#register_source({ | ||
\ 'name' : 'Laravel Route', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\ 'name' : 'Laravel Route', | |
\ 'name': 'Laravel Route', |
plugin/laravel.vim
Outdated
\ 'name' : 'Laravel Route', | ||
\ 'priority': 9, | ||
\ 'subscope_enable': 1, | ||
\ 'scope': ['php','blade'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\ 'scope': ['php','blade'], | |
\ 'scope': ['php', 'blade'], |
plugin/laravel.vim
Outdated
\ 'name' : 'Laravel View', | ||
\ 'priority': 9, | ||
\ 'subscope_enable': 1, | ||
\ 'scope': ['php','blade'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\ 'scope': ['php','blade'], | |
\ 'scope': ['php', 'blade'], |
Honestly I shouldn't have missed these to begin with :O
It does work for me locally, but I wouldn't mind somebody else trying. Do you know anybody else using ncm2? How is your autocomplete currently broken? Maybe we could fix it and test my changes? |
That's strange, that doesn't happen for me. Can you share your minimal configuration so I can also try it? |
Replace paths to local copies of plug-ins as needed: call plug#begin()
call plug#('roxma/nvim-yarp')
call plug#('ncm2/ncm2')
call plug#('~/src/vim-composer')
call plug#('~/src/vim-laravel')
call plug#end()
augroup init_ncm2
autocmd!
autocmd BufEnter * call ncm2#enable_for_buffer()
augroup END
set completeopt=menuone " Display menu when completing, even for only one candidate
set completeopt+=noselect " Do not automatically select first item
set completeopt+=noinsert " Do not automatically insert first item Starting Neovim 0.3.8 in a Laravel project with: nvim -u path/to/minimal.vim app/Http/Controllers/Controller.php |
I've been reading through the documentation. I think the |
Hm, I do see this bug now, but only after I call |
I did not, since it's a strict subset of my normal config. It shouldn't make a difference in my case.
Can you tell from what script? |
Hey, I found this in the docs:
This part being important:
Care to pull my changes and see if this is fixed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected now!
* Fix :Artisan make:model in Laravel 8. * Add support for artisan make:channel generator introduced in Laravel 5.6. * Dynamically complete Artisan flags. * Fold stack traces in log buffers. * Make gf go to intended config/translation file. * Implement completion via ncm2 (#15). * Always set up job/command nav commands. * Various bug fixes.
Note: this will break for anybody that currently uses ncm. I wasn't sure the right way to handle this - add a whole new group of stuff for ncm2, or just update it. I figured I would update it first since that was the easier path.
I tried to run the tests but
bundle install
failed, stating:Could not locate Gemfile
In order to get the routes completion working for ncm2, I had to make
the
capture()
function available from anywhere, and I needed to call itwith 2 arguments intead of 1.