-
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.nvim] Error on active extension coc-powershell: TypeError: (intermediate value) is not iterable #77
Comments
I started getting this error recently too. It was working a few weeks ago. PowerShell/Windows:
Coc info:
|
Are you using gVim? I heard there was an issue with gVim and I don't think there's much we can do about that. |
Yes, I'm using gVim. The problem occurs on Vim too (Windows again). This was working a few months ago. I've reverted back to several Vim versions that I've compiled over the past year and also compiled the latest Vim (8.1.2176). None of them worked. I've tried the coc JavaScript and Python plugins and they're working in gVim. I've also updated nodejs to the latest version: v10.16.3. Is there any diagnostics I could do to help? |
I have reproduced the issue. |
Fixed by neoclide/coc.nvim@36e4768, there is an unnamed variable, also improved the error message |
I can confirm that the error has disappeared. Auto-completion is now working and a PowerShell Integrated Console appears when a However, when the
The version of PowerShell in the console is 5.1 not the 6.2 that's installed. Is there a reason the latest version isn't used? Both are in the path but 6.2 appears first in the |
Thanks @chemzqm! 🎉
You mean the actual PowerShell shell that you launched gvim from? Or the PowerShell Integrated Console? If the latter, try
We don't look at the PATH because it's expensive. Currently on Windows, we use 5.1 by default. You can change this by adding That code path will change, once PowerShell/vscode-powershell#2238 goes through in the vscode extension. That will have PowerShell Core be the default if it is installed. |
I'm referring here to the PowerShell Integrated Console. Once that becomes the sole window open in gvim, I can't do anything except type in the console! The gvim menus are disabled and If I
Thanks, that worked. Is there a reason that my PowerShell profile is not being invoked (for either 5.1 or 6.2) when the PowerShell Integrated Console appears? BTW, thank you for providing an incredibly useful plugin! |
First do
It's a different profile. In the PowerShell Integrated Console, run This is similar to how the VSCode extension or ISE have different profiles. |
@TylerLeonhardt is this because you're planning to bring the update into coc-powershell? |
@corbob yep. In fact, I might steal that code and publish it on npm. |
Thanks - that works. However, the behaviour is quirky. If I close the script first (
After I click I then repeat the above sequence: go to normal mode on the newly created PSIC, click Vim display the same behaviour as gvim. This is all on Windows 10 1903. This used to all work seamlessly when I last used it (about five months ago). Was there a PSIC because I don't remember one? Is it necessary to have a (visible or invisible) PSIC at all?
The profile |
It's kinda new... There's a setting to hide it at start up. It's like...
It's a different host and therefore should be a different profile. That's typically the guidance. |
This is also what is done in the ISE and vscode. If you populate |
Thanks @chemzqm Now it works. |
The above works. However, the PSIC is just hidden. The same If you try to
with possible options of "Yes", "No" and "Cancel". Regardless of which you choose, nothing visibly happens! So the only way of closing the PSIC is to quit (g)vim on Windows. Is this intentional behaviour? What problem was the PSIC solving when it was introduced that warrants tolerating the prompts?! @corbob |
Please understand that I don't think this prompt appeared before and doesn't appear on non-Windows which is what I use. This is a 100% community driven product and some things will be missed/bugs will show up since it's very difficult to write proper tests. That said, @yatli has typically been the one "manually testing by using" on Windows - have you seen this before? PSIC was introduced to provide an ISE-like experience where you can select a line of code, hit F8 and it will run it in the PSIC below. It was an experience we were trying to align with. |
@Praful here's the doc on profiles which should help in understanding what each profile in PowerShell does and when it gets run. |
@TylerLeonhardt sorry - I didn't mean to sound critical but rather understand the rationale behind the feature. I'm not an ISE user but it's reasonable to emulate some of its features. I like the sound of the F8 command.
I read this when @corbob mentioned the $profile NoteProperty types. However, I couldn't see anywhere to set them. In the PSIC none of the four $profile member properties refer to the default Windows profile. So I tried calling my Windows PS profile from |
@TylerLeonhardt in addition to That said, it's still a bit strange to have to tear down a shell when the last |
@Praful no worries! The Make sure you comment out the code in the normal console profile so that you don't have the same code running twice! |
I've made vim kill the terminal job when window is closed. |
Ah, I see. I was trying to change what the variable pointed to. It was as simple as renaming
Thanks - that's removed the In case you expected otherwise, I still can't |
System Details
vim --version
) or NeoVim (runnvim --version
): 8.1coc-powershell
(in Vim or NeoVim::CocList extensions coc-powershell
): 0.0.21$PSVersionTable
): 5.1.17763.592Issue Description
[coc.nvim] Error on active extension coc-powershell: TypeError: (intermediate value) is not iterable
Expected Behaviour
No error on loading extension
Actual Behaviour
Above error
and extension not active.
CocInfo:
The text was updated successfully, but these errors were encountered: