IDE and classes

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 3 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
akincer
Posts: 43
Last visit: Thu Mar 14, 2024 7:53 am

IDE and classes

Post by akincer »

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: Powershell Studio 2019 build 5.6.167
32 or 64 bit version of product: 64 bit
Operating system: Windows 10
32 or 64 bit OS: 64 bit

*** Please add details and screenshots as needed below. ***

I'm building a project with multiple classes and the IDE acts like it doesn't know about the other classes when I use one in a class but it does when I use one in main. The code itself runs fine, but I don't get any class method hints and on the left it has an error arrow with "Unable to find type [ClassName]".

Is there some way to get the method hints for one class when using in another?
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 1:00 pm
Answers: 39
Been upvoted: 30 times

Re: IDE and classes

Post by brittneyr »

With your project open, set your class ps1 files Shared property to true from the Properties panel:
SPS_PropertiesSharedTrue.png
SPS_PropertiesSharedTrue.png (15.1 KiB) Viewed 1443 times
Your classes should then appear in the Functions panel.
When a project is built, the script files and psf files are exported into one script file. This is why your project still runs despite your classes not being found in the editor.
Brittney
SAPIEN Technologies, Inc.
User avatar
akincer
Posts: 43
Last visit: Thu Mar 14, 2024 7:53 am

Re: IDE and classes

Post by akincer »

brittneyr wrote: Wed Aug 05, 2020 11:03 am With your project open, set your class ps1 files Shared property to true from the Properties panel:
SPS_PropertiesSharedTrue.png

Your classes should then appear in the Functions panel.
When a project is built, the script files and psf files are exported into one script file. This is why your project still runs despite your classes not being found in the editor.
That's already set and it still has the issue.
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 1:00 pm
Answers: 39
Been upvoted: 30 times

Re: IDE and classes

Post by brittneyr »

That needs to be set true for all class ps1 files. I have not been able to replicate this issue.
What type of project are you using?
How are you instantiating your class and calling your methods?
Without seeing code, there is a limit on to how much I can assist you. Can you upload your project here:
https://www.sapien.com/support/upload
Brittney
SAPIEN Technologies, Inc.
User avatar
akincer
Posts: 43
Last visit: Thu Mar 14, 2024 7:53 am

Re: IDE and classes

Post by akincer »

I figured out why type hinting wasn't working while trying to recreate. I had removed the type casting in the property declaration because of some troubleshooting. Adding it back fixed hinting but the error in the IDE on the left saying "Unable to find type [MyType]" persists. Maybe just a harmless bug?

And yeah -- that's just a touch embarrassing.
This topic is 3 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.