Editor Bug During Copy/Paste Operations

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 2 years and 6 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.
bill-douse
Posts: 17
Last visit: Mon Sep 25, 2023 3:12 pm

Editor Bug During Copy/Paste Operations

Post by bill-douse »

Product: PowerShell Studio 2021 (64 Bit)
Build: v5.8.192
OS: Windows 10 Pro for Workstations (64 Bit)
Build: v10.0.19043.0
PowerShell version(s): 5.1.19041.1151

I believe I have run across a very annoying bug in the PS Studio Editor. I recorded a video illustrating the actual error, which is easily duplicated. Every time I perform a cut and paste of one line of code containing a text string between double quotes the editor's parser gets corrupted. This issue causes several subsequent lines of code to no longer validate properly until I retype the opening double quote on the offending line of code. This happens just about every time I cut and paste similar lines. See attached pic of the actual error after perform a copy of the top line of code. All lines beneath it turned black indicating that they are parsing errors when there are not any.
Sapien-Editor-Bug.png
Sapien-Editor-Bug.png (14.18 KiB) Viewed 8919 times
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 1:00 pm
Answers: 39
Been upvoted: 30 times

Re: Editor Bug During Copy/Paste Operations

Post by brittneyr »

Does this happen with any double quote string or is it only with a specific string?
Can you please upload a PowerShell file demonstrating this behavior:
https://www.sapien.com/support/upload
Brittney
SAPIEN Technologies, Inc.
bill-douse
Posts: 17
Last visit: Mon Sep 25, 2023 3:12 pm

Re: Editor Bug During Copy/Paste Operations

Post by bill-douse »

It appears to be happening with every line of code that uses a "$(Get-Date -Format g)" in the string content, which only consists of double quotes. I also noticed that if I restart the PS Studio program the bug will stop for a while. But, after about 20-30 minutes of editing it starts again. After retyping the opening quote everything seems to fix itself. BTW: As a result of this bug, I keep getting these "Event Missing" dialogs when I attempt to run the application. The app still runs without issue though. I believe it is due to the corruption, which causes the parser to fail to interpret correctly the code that follows the offending line of code. But, if that were the case then why does the application still run without issue. Strange.

I cannot include the actual PS code file due to its sensitive nature. But, I do have an MP4 recording of the actual bug, which is about 1.6MB in size.
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 1:00 pm
Answers: 39
Been upvoted: 30 times

Re: Editor Bug During Copy/Paste Operations

Post by brittneyr »

Does this happen on all scripts or just this script when copying and pasting lines with "$(Get-Date -Format g)"?
Is the coloring fixed if you format the script (Home->Edit):
SPS_FormatScript.png
SPS_FormatScript.png (16.37 KiB) Viewed 8728 times
Also, the script demonstrating this behavior does not need to be the actual script; it just be a sample script to help us reproduce this behavior.
Brittney
SAPIEN Technologies, Inc.
bill-douse
Posts: 17
Last visit: Mon Sep 25, 2023 3:12 pm

Re: Editor Bug During Copy/Paste Operations

Post by bill-douse »

It has been working fine today because I haven't been doing a lot of editing of PS scripts. I'll keep at it today until it starts doing it again, and then I'll try using the Format Script feature to see if that fixes it.

Yes. It was only happening when I cut & pasted those specific lines of code that contained the "(Get-Date -Format g)" statements, which I have probably between 50 to 100 of these lines in my script. I haven't noticed it happening on any other lines of code.

BTW: The project files I am working on have combined over 4000 lines of code contained in only 2 scripts. So, I am not sure what part of these two scripts you would like to review. The issue I am experiencing happens while editing either one of the scripts, and is not specific to any one section of either of the scripts. It is pretty much a global issue across the entire project. When it starts happening, it happens no matter where or what script I am editing at that moment in the current project environment. Now, if I were to close the project and create a new standalone PS script and then cut & paste the same lines of code, it does not happen. Strange.
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 1:00 pm
Answers: 39
Been upvoted: 30 times

Re: Editor Bug During Copy/Paste Operations

Post by brittneyr »

I have been able to reproduce this issue with copying lines with "$(Get-Date -Format g)". I have filed a bug report for the development team and will update you when I have more information.

If it happens again, please let me know if formatting the script resolves the issue for you as a temporary workaround.
Brittney
SAPIEN Technologies, Inc.
bill-douse
Posts: 17
Last visit: Mon Sep 25, 2023 3:12 pm

Re: Editor Bug During Copy/Paste Operations

Post by bill-douse »

It did start happening again today after about 4 hours of editing scripts. Using the Format Script feature did fix the issue when it happened.

-Bill D.
This topic is 2 years and 6 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.