-
Notifications
You must be signed in to change notification settings - Fork 500
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
Issues with 'Using Module' and classes #1076
Comments
This appears to work as expected when using PowerShell Core. |
Thanks for the report! Just to understand you more, do you mean that intillisense/"go to definition" isn't working for classes? Can you share some code and a screenshot of the "unable to find type" errors? |
Can you try one thing for me? When you get the "Unable to find type" error, can you try F8'ing the Also could you try restarting the PowerShell session using the command pallet and see if that fixes it? Thanks for your patience! |
Okay, I just tried executing F8 on the Using Module line, and I see it executing in the Integrated Console, but the errors persist. I have also run "Restart Current Session", the result is the same. FYI, I am switching to PowerShell Core going forward so this won't be an issue for me personally, but it would be good to know why this causes errors in PowerShell 5.1 |
Hello, Same issue here
|
If the problem is the red squigglies appearing under types imported with I believe something like this was addressed in PSScriptAnalyzer: PowerShell/PSScriptAnalyzer#957. And it looks like there hasn't been a PSScriptAnalyzer release in a little while, so maybe that will fix it? PS classes defined in other files imported with Completions for |
My problem is that the "Go to definition" doesn't work for classes definitions and methods. Maybe I misunderstood this ticket and should open a new issue ? |
Ah, just saw the images above. Yes, the unable to find type part is a PSScriptAnalyzer thing. But we should be able to do something about the "Go to definition". We'll look into this. Thanks for the report! |
Just to add on to what @rjmholt said, "Go to definition" doesn't work because we are using legacy AST APIs to support PowerShell v3/v4 in the extension. We are looking to drop 3,4 which will allow us to use modern AST APIs which should give us symbols for classes. I'm going to close this issue because @LethiferousMoose's original issue is the PSScriptAnalyzer issue that @rjmholt mentioned, and the issue @AlexBillon07 is having is tracked with #3 If you see otherwise, feel free to drop a message here! |
System Details
Issue Description
When using a class from a different module, the PowerShell plugin cannot locate the class source. I have a module which contains class definitions, then in another module I use the "Using module " to load the classes into the session for the module to use. It would be nice if the plugin could locate the supplied module and load in the classes to stop the editor "Unable to find type" errors from occurring.
The text was updated successfully, but these errors were encountered: