-
Notifications
You must be signed in to change notification settings - Fork 511
Intellisense provides a lot of junk #1352
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
Comments
Is a PowerShell Editor Services session running? Look in the lower right of the window and it should show the version of PowerShell it is using for the session: If the session is not running you will not get any auto-completion other than what VSCode provides - which is just the tokens in your file. |
OK, so the PowerShell Editor Services session is running. The next couple of things to try to rule out is script analysis and codelens. You can disable them with the following settings:
|
@PrzemyslawKlys In this case, the PS editor services is reporting no more completions back to VSCode e.g.:
What you are seeing in the completion list above is provided by VSCode and it represents matching tokens (those starting with I'm looking around to see if there is a way to indicate to VSCode that there are no more valid completions in this situation. So far, I'm coming up with nothing. |
That's what I thought after a couple of your explanation posts above. It would be nice to know Editor Services are done with it's work and now you are using VSCode junk ;) Thanks for looking into this. |
Here is another example. As you can see it's not showing any good help for The Add-WordText is available here: https://github.com/EvotecIT/PSWriteWord/blob/master/Public/PSWordParagraph.ps1 Maybe it's just the way I use it... |
Hey @PrzemyslawKlys, Thanks for the gifs, they're really helpful! So I think the gif about Your second gif, I think, is actually a limitation of PowerShell. If you load that cmdlet |
Hey @tylerl0706 , You are right. I get same behaviour in ISE and powershell for bool[]. As for the 1st example it seems variable type needs to defined. If it's not defined you won't get completion in ISE either. When I changed it to bool it works straight away. So I guess in both cases it's kind of expected although confusing. Przemek |
Both the ISE and VSCode PowerShell get completions via Definitely open an issue on PowerShell voicing this so we can fix it there 😃 If TabExpansion2 doesn't give VSCode any results, VSCode tries to "help" by supplying completions of things you've typed previously or common PowerShell things. You might be able to disable these but I'm not sure off the top of my head - I think that's really on VSCode. |
@PrzemyslawKlys, to import those types properly, you might want to try the |
@rjmholt I actually followed different pattern where I've use ScriptsToProcess in .psd1 where I've put all Enums in. https://github.com/EvotecIT/PSWriteWord/blob/master/PSWriteWord.psd1 That's what I found in someones other script. In the test I did, it was just a test so haven't really verified it. Assumed it would work. I will read on Using in PowerShell. I know using in C#. Eh there's a lot to learn ;-) |
@tylerl0706 but isn't that for PowerShell 6+ only? I'm still using the standard version? Or will you port it to the Windows edition as well if I report it as a bug? |
It won't get ported back to Windows PowerShell but eventually PowerShell 6+ will become the version of PowerShell everyone uses so it would be nice to have an issue to track that we could do better in |
Another example... notice how I type -Autofit ... it should only provide 4 entries (the top ones). For some reason it provides a bunch. Then i go and change -Design... notice notice how it push me to the last entries showing me junk and I have to scroll up. It's not related to [] or anything. Just enum loaded from module I wrote. |
@PrzemyslawKlys those are snippets, VSCode will display them regardless of what this extension says the results should be. You can disable that with this setting: "editor.snippetSuggestions": "none", |
@SeeminglyScience Did I ever told you I love you? If not, here's the first time! Works as advertised. Now question is, should I close this one? Or do you think that earlier issue requires any work? |
Looks like the other issues in the thread are related to the completions provided by the engine. I didn't look close enough to tell if they've already been reported, but any issues for improving the engine's completion would need to be on the PowerShell repo. In other words, yeah I suspect this can safely closed. |
System Details
Actually enabled extensions (the list above has all installed). Probably would be better for you to give a command to get only enabled extensions right?
Issue Description
Intellisense is providing a lot of junk.
Notice how it was able to pick up the full Set-DriveSettings definition and what it proposes for filling in.
Attached Logs
I've attached lots of logs in different bug report. Let me know if you need more.
The text was updated successfully, but these errors were encountered: