[PSS 2017][Bug] Module Project: Go to declaration is missing

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 7 years and 3 weeks 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.
Bosparan
Posts: 290
Last visit: Fri Oct 08, 2021 11:59 am

[PSS 2017][Bug] Module Project: Go to declaration is missing

Post by Bosparan »

PSS Version: 2017 5.4.136 x64
OS Version: Windows 10 x64
WMF Version: 5.1

Impact: Medium

Symptom:
When I have a module project and at the same time, there is a copy of the module in the cache (not unlikely, one likes to test and use his own products), I am unable to select "Go to declaration" on a function that is also published in the module that is available in the cache, since it prioritizes the module function over its implementation in the module project you are currently editing.
It also doesn't update new or renamed parameters for the same reason.

Reproducibility:
- Create Module Project, make sure all files are set to Build = Content & Shared = True
- Add a function, make sure the module publishes it
- Publish Module
- In the project, create a second function that calls the first function
- Rightclick on the call --> "Go to declaration" will be missing. The Primal Sense shows the published module the PS is from.
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: [PSS 2017][Bug] Module Project: Go to declaration is missing

Post by DevinL »

I've managed to reproduce this on my end and have filed an internal bug report.

Thank you for bringing this to our attention. When we have some news to share, we'll be sure to post it here.
DevinL
SAPIEN Technologies, Inc.
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: [PSS 2017][Bug] Module Project: Go to declaration is missing

Post by DevinL »

Quick follow up question.. Do you declare these functions in your psm1 module file and then export them?
DevinL
SAPIEN Technologies, Inc.
Bosparan
Posts: 290
Last visit: Fri Oct 08, 2021 11:59 am

Re: [PSS 2017][Bug] Module Project: Go to declaration is missing

Post by Bosparan »

Hi Devin,

I generally split my module into individual files, that are imported in the psm1.
Publishing is done using the manifest.

For a representative example (in fact I'm working on that project), check out dbatools.
That's pretty much how I build my modules.

This issue obviously only affects published functions, as internal ones wouldn't be found in published modules and thus wouldn't be available to cover the project-internal files.

Cheers,
Fred
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: [PSS 2017][Bug] Module Project: Go to declaration is missing

Post by DevinL »

I remember you mentioning that project before, I don't know why I'm only just now downloading it to use for testing.

Thanks for the additional info, I've passed this off to David and we'll have it taken care of as soon as possible.
DevinL
SAPIEN Technologies, Inc.
Bosparan
Posts: 290
Last visit: Fri Oct 08, 2021 11:59 am

Re: [PSS 2017][Bug] Module Project: Go to declaration is missing

Post by Bosparan »

It's a nice test-case since it's
a) A production project
b) It's seriously large (hundreds of files)
c) It's open source, so we don't have the issues we get with sharing proprietary code

Just in case you want to automate a little and didn't catch my previous links on that topic, here's my guide on converting modules into module projects:
http://allthingspowershell.blogspot.de/ ... odule.html
This topic is 7 years and 3 weeks 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.