Intellisense not working/cache not building

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 1 year and 10 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
PsCustomObject
Posts: 137
Last visit: Thu Mar 28, 2024 3:34 am

Re: Intellisense not working/cache not building

Post by PsCustomObject »

Yet .Net framework runtime is installed and all modules, included custom ones, can be importated from an interactive session or VsCode for what matters.

Thanks for your help!
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Intellisense not working/cache not building

Post by Alexander Riedel »

I can confirm that I see the effect with az.sql in Windows PowerShell. Now for the why that is ...
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
PsCustomObject
Posts: 137
Last visit: Thu Mar 28, 2024 3:34 am

Re: Intellisense not working/cache not building

Post by PsCustomObject »

Magic, I came to the conclusion it's either

A) Computers do hate us
B) It's magic

But I tend to believe B more, know one thing. I'm working with another editor and hating every minute of it, on the bright side I am appreciating your products even more :-)

Today I tried to uninstall module and install it only for my user account, rebuilding cache and rebooting in between changes,yet issue persists. Not adding much but hopefully can be of some help.

*Edit* I am glad you could reproduce this and I am not completely crazy...
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Intellisense not working/cache not building

Post by Alexander Riedel »

The same script that is used by our cachebuilder and fails on az.sql, runs fine, without modification, in a console.
So it's some voodoo that they do. Don't worry I get to the bottom of it, eventually. It is possible that they check the host and if its not the console, bam, no load. Would not be the first time...
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Intellisense not working/cache not building

Post by Alexander Riedel »

Just to keep you in the loop. It appears the az.sql module cannot be loaded correctly when one or more other az.* modules have already been loaded.
We are working on a remedy, please stand by.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
PsCustomObject
Posts: 137
Last visit: Thu Mar 28, 2024 3:34 am

Re: Intellisense not working/cache not building

Post by PsCustomObject »

Thanks a lot Alexander, in effect I've installed all modules with Install-Module az which is just a wrapper so it makes sense somehow, still don't understand why my custom module is affected as well but, for example, but one step at time :)

Again many thanks!
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Intellisense not working/cache not building

Post by Alexander Riedel »

I will upload some updated components for testing shortly. If you are up for some testing.
I have been debugging this for a while now, and it seems the following happens:
Some modules (without outside reason) load fine but do not report exported cmdlets etc at all on first load.
The cachebuilder saves the empty export and never tries again, since it thinks it has that info about the module.
On subsequent runs it seems these modules then report the exported bits. At least that is how it works here.
I have modified some components to not store empty information and create a fault log.

If you are up to it, we can try that on your machine and see what happens.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Intellisense not working/cache not building

Post by Alexander Riedel »

As you can see, the module is included in the cached information.
2022-05-09_22-33-50.png
2022-05-09_22-33-50.png (125.06 KiB) Viewed 2027 times
The two files (CacheProxyV5.dll and ModuleImporterV5.dll) in the zip go here:
C:\Program Files\SAPIEN Technologies, Inc\PowerShell Studio 2022\CacheBuilder64

Please make certain that you make a copy of the original files and restore them after this test.
Also delete the copies if you keep them in the same folder.
Otherwise Windows installer may have a fit on the next update.

Delete all the damaged / module files here: C:\ProgramData\SAPIEN\PresetCache 2.1\ModuleCacheV5

Once you have place the files there, open a console in that folder
and run

Cachebuilder64.exe /VERBOSE /V5
Please post the files ModuleV5_64bit.log and, if it would exist, FaultModules.log here afterwards.

Thanks for your help on this.
Attachments
ModuleImporterV5.zip
(53.37 KiB) Downloaded 60 times
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
PsCustomObject
Posts: 137
Last visit: Thu Mar 28, 2024 3:34 am

Re: Intellisense not working/cache not building

Post by PsCustomObject »

I am always up for testing and debugging :-)

I'm downloading/copying right now and will let you know the outcome.
User avatar
PsCustomObject
Posts: 137
Last visit: Thu Mar 28, 2024 3:34 am

Re: Intellisense not working/cache not building

Post by PsCustomObject »

Well thanks to you Alexander and team for the help and patience on this :)

So I did as instructed, command runs without errors but I do not see neither log in the folder of cachebuilder (unless it got created somewhere else for unknown reasons).

I can confirm AZ* modules have been correctly cached and are now reconigzed by intellisense despite some cmdlets, Microsoft.OnlineSharePOint.PowerShell (damn you SP team for the name) or SharePointPnPPowerShellOnline or even "our" Dental-Module, still showing in object browser as empty and not reconigzed by intellisense.

Not sure if this was expected but worth mentioning anyhow,keep in mind before running the command I deleted the various .alias, .syntax and .cmdlets files which have NOT been recreated by running the .exe from an elevated powershell session.

I have now reverted back the DLL change but of course if there is any test I can carry on please let me know, also if this is beneficial I can send across a copy of the module for which I originally opened the post, just let me know if you have an SFTP server/private mail where I can send it, nothing too sensitive in there but yet would rather not having it around in the wild :-)

Thanks again!
This topic is 1 year and 10 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.