-
Notifications
You must be signed in to change notification settings - Fork 9
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
coc-powershell unresponsive #106
Comments
Have you tried using vim-polyglot mentioned in the recommended plug-ins? https://github.com/coc-extensions/coc-powershell#recommended-plugins Does that change anything for you (besides the obvious 'it now has highlighting')? |
vim-polyglot is the second entry in my plug section of my init.vim, right
after coc.nvim itself. Everything is up to date. I've been using this for
about a year without issue - I'm not even sure where to start tracking down
the issue.
…On Fri, Aug 21, 2020 at 10:42 AM Tyler James Leonhardt < ***@***.***> wrote:
Have you tried using vim-polyglot mentioned in the recommended plug-ins?
https://github.com/coc-extensions/coc-powershell#recommended-plugins
Does that change anything for you (besides the obvious 'it now has
highlighting')?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#106 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE2BFH2XQFE2HLRJ6OL4HHTSB2BXFANCNFSM4QHJ7UZQ>
.
|
I've done some more testing. After activating the extension manually (:CocList / extensions / coc-powershell), the Integrated console opens and, eventually PSScriptAnalyzer becomes reponsive. In addition, if I manually specify the filetype (:CocList / filetype / ps1), then all of the expected functionality for Powershell files is enabled. It seems like coc is not recognizing or triggering the extension when I open a ps1 file from the command line or from within nvim. It seems I have to do this everytime I reopen nvim. |
@lc9er when you open the ps1 for the first time, what is the filetype?:
|
I think you're onto something. When I open a ps1 and run When I set the filetype using CoC, So I think that explains why this happening, but I'm unsure as to how to fix this (or how this has happened at all - I've done plugin updates, but haven't changed my config). |
We usually recommend vim polyglot because it sets the ft to ps1: You may need to remove your packages 1 by 1 to figure it out. I'm curious which package is to blame. |
When I remove polyglot, then open ps1 file, run I tracked down how Coc.nvim discovers filetypes. In C:\Users<uid>\AppData\Local\coc\extensions\node_modules\coc-lists\lib\filetypes.js, you see this line let filetypes = await nvim.eval(`sort(map(split(globpath(&rtp, 'syntax/*.vim'), '\n'),'fnamemodify(v:val, ":t:r")'))`); So it looks like it just rifles through the plugins directory and pulls the name off the .vim files. I re-installed polyglot and tried copying ps1.vim to powershell.vim, seeing if that would works as an ugly hack. Highlighting worked, thanks to polyglot, but it still did not trigger the coc-powershell extension. Somewhere, the powershell=ps1 mapping seems to have been lost. I can't figure out if that's a Coc or coc-powershell issue. |
Oh interesting... this might be a matter of simply adding to our package.json: Lines 34 to 36 in 92d7fd6
adding an Do you think you could test that out for me? |
Is filetype guaranteed to be lower case? As another just in case, should we add |
This gets it closer to working! It activates the coc-powershell extension, so that the integrated terminal opens, completion, and PSScriptanalyzer integration are all working. No syntax highlighting from polyglot, though. Note that I removed the powershell.vim copy of ps1.vim that I created in polyglot's syntax directory. I'm not sure if at this point, it's an issue with vim-polyglot or not. |
Ok so we need to update our activationEvents for sure. That's easy. @corbob that's a good point on casing. I'm not sure. Now polyglot problem... hmm I really don't know tbh. What you could do is...
That would prove that whatever is setting filetype to powershell is not coc-powershell. |
Found it! I searched through the old vim-polyglot issues and found this, which mentions PProvost/vim-ps1. I installed the plugin, opened a ps1 file and nvim showed the filetype as I reinstalled Coc.nvim and now everything is working as expected. |
That was ages ago though... weird you saw it only now. |
When I first discovered coc-powershell, I had that plugin installed. I believe it was listed in the README, but removed it a long time ago. As in many months ago. I use nvim + coc-powershell everyday, and update my plugins frequently, so yeah - I'm just as confused as to why it became an issue now. But does this mean that vim-ps1 should be included as a requirement? I'd hate for someone else to install the plugin and think it's not working. |
well we just need to do what I mentioned above to fix btw, do you want to submit a PR for that since it worked for you? |
Sure! I’ll give it a try later today. This will be my first attempt at
submitting a PR, so I’ll do my best.
…On Fri, Aug 28, 2020 at 6:29 PM Tyler James Leonhardt < ***@***.***> wrote:
But does this mean that vim-ps1 should be included as a requirement? I'd
hate for someone else to install the plugin and think it's not working.
well we just need to do what I mentioned above to fix coc-powershell:
#106 (comment)
<#106 (comment)>
btw, do you want to submit a PR for that since it worked for you?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#106 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE2BFHZZ5UL4DTKA6IY4T6DSDAVS3ANCNFSM4QHJ7UZQ>
.
|
Happy to help if you need it :) just let me know here. |
#108) * Fixes issue #106 - coc-powershell fails to open automatically for ps1 filetypes. * Update package.json Co-authored-by: corbob <[email protected]> Co-authored-by: Brian McGraw <[email protected]> Co-authored-by: corbob <[email protected]>
Closing this now that it's fixed :) |
System Details
vim --version
) or NeoVim (runnvim --version
): 0.4.3coc-powershell
(in Vim or NeoVim::CocList extensions coc-powershell
): 0.1.2$PSVersionTable
): 7.0.3Issue Description
I am experiencing a problem with...
I run 'nvim some.ps1', the file opens, Neovim recognizes it as a Powershell file (according to statusline, but nothing else happens. There's no syntax highlighting, no linting, no completion, no terminal. If I manually start the extension, the integrated terminal appears, but the other features are still missing.
Expected Behaviour
-- Description of what should be happening --
I should open a ps1 file. the integrated terminal should open. I should see syntax highlighting, code completion, and linting.
Actual Behaviour
-- Description of what actually happens --
Nothing happens. It doesn't seem like the extension is functioning at all. Other extensions are functioning - the extensions for Rust and Python are functioning. I've also duplicated the same problem in vim 8.2, as well as with Neovim 0.4.4/pwsh 7.0.1/coc-powershell 0.1.2 on Ubuntu 18.04 WSL.
The text was updated successfully, but these errors were encountered: