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.
User avatar
PsCustomObject
Posts: 128
Last visit: Thu Sep 15, 2022 9:10 am

Intellisense not working/cache not building

Post by PsCustomObject »

Product: PowerShell Studio 2022 (64 Bit)
Build: v5.8.205
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.22000.0

Hello,

I had to reinstall my machine today and together with it my beloved editor :) Issue I am facing is cache is not being built correctly, despite output telling me otherwise, and as a result intellisense within my scripts is not working (cmdlet calls are not correctly highlighted).

I tried rebuilding cache manually multiple times, I made sure that modules from which I'm calling cmdlets are listed for caching and all seems in working order, no error message or anything is displayed in the output console yet intellisense is not working (I have verified in the cache folder as well modules I am using are listed but still to no avail).

In the past I had similar issues where it took some time for cache to be properly recognized, so to speak, but this time nothing seems to work and system has been running for more than 10 hours now so it had plenty of time to build cache/recover.

Thanks in advance for any suggestion/pointer/help
User avatar
brittneyr
Site Admin
Posts: 1209
Last visit: Thu Sep 29, 2022 8:12 am
Answers: 25
Been upvoted: 20 times

Re: Intellisense not working/cache not building

Post by brittneyr »

Do you have PowerShell 7 installed? If so, what version?

Can you tell what the status says for these two files:
C:\Users\[User]\AppData\Roaming\SAPIEN\CachedData 2.1\Local Machine\CacheBuilder64.inf
C:\Users\[User]AppData\Roaming\SAPIEN\CachedData 2.1\Local Machine\CacheBuilder32.inf
Brittney
SAPIEN Technologies, Inc.
User avatar
PsCustomObject
Posts: 128
Last visit: Thu Sep 15, 2022 9:10 am

Re: Intellisense not working/cache not building

Post by PsCustomObject »

Yes version 7.2.3 is installed on the system.

Here's content of the two files you mentioned:
CacheBuilder32

Code: Select all

[CacheBuilder]
Status=Finished
PowerShell interface could not be instantiated
[CacheVersion]
x86=
CacheBuilder64

Code: Select all

[CacheBuilder]
Status=Finished
[CacheVersion]
X64=7.2.3
Please let me know if there is any additional detail I can attach to help with the troubleshooting.
User avatar
brittneyr
Site Admin
Posts: 1209
Last visit: Thu Sep 29, 2022 8:12 am
Answers: 25
Been upvoted: 20 times

Re: Intellisense not working/cache not building

Post by brittneyr »

The latest build does not support PowerShell 7.2.3 so that may be why you are seeing this behavior.

PowerShell 7.2.3 support will be included in the next service release of PowerShell Studio (5.8.206) which will be released very soon.
Brittney
SAPIEN Technologies, Inc.
User avatar
PsCustomObject
Posts: 128
Last visit: Thu Sep 15, 2022 9:10 am

Re: Intellisense not working/cache not building

Post by PsCustomObject »

Thanks, I understand, but what about PowerShell 5.1?

Targeting that in the IDE has no effect, also keep in mind that's what I used during modules installation.

Thanks for the clarification.
User avatar
brittneyr
Site Admin
Posts: 1209
Last visit: Thu Sep 29, 2022 8:12 am
Answers: 25
Been upvoted: 20 times

Re: Intellisense not working/cache not building

Post by brittneyr »

Are these commands from a module you have installed? Are the commands that are not highlighted available in v5.1?

It could be that v7.2.3 messed with the caching process for v5.1, but that would need to be investigated.
Brittney
SAPIEN Technologies, Inc.
User avatar
PsCustomObject
Posts: 128
Last visit: Thu Sep 15, 2022 9:10 am

Re: Intellisense not working/cache not building

Post by PsCustomObject »

Yes commands are from installed modules, some standard like AzureAD others are internal stuff we maintain, and I can consume them from both 5.1 and 7.X interactive sessions.

I can live without intellisense for some time not a big deal, I used to code in Vi so :), but if you can benefit from investigating this for future enhancements etc feel free to let me know I'm happy to assist.
User avatar
brittneyr
Site Admin
Posts: 1209
Last visit: Thu Sep 29, 2022 8:12 am
Answers: 25
Been upvoted: 20 times

Re: Intellisense not working/cache not building

Post by brittneyr »

Please try service build 5.8.206 and let me know if this fixes things.

I used it use emacs :)
Brittney
SAPIEN Technologies, Inc.
User avatar
PsCustomObject
Posts: 128
Last visit: Thu Sep 15, 2022 9:10 am

Re: Intellisense not working/cache not building

Post by PsCustomObject »

Ahahah then I ask that another agent is assigned to the case, we speak different languages ;-)

All jokes apart I just upgraded to latest build and alas issue is still there :-( Cache has been rebuilt and took a good chunk of time which made me hope issue was solved that was not the case.

I will check during the day and if anything changes I will post an update.
User avatar
PsCustomObject
Posts: 128
Last visit: Thu Sep 15, 2022 9:10 am

Re: Intellisense not working/cache not building

Post by PsCustomObject »

Just to add, now when I'm trying to run scriptanalyzer I get the following

Code: Select all

The term 'Invoke-ScriptAnalyzer' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
PsScriptAnalyzer is indeed there and working from an interactive session (it lives within my user profile but also moving to Program Files did not help much) :-(

On a side note caching problem is still present despite restarting application and rebuilding cache couple of times.