SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[12.4.474 Pro] - BUG: $CURRENT(...) broken for SQL Server

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[12.4.474 Pro] - BUG: $CURRENT(...) broken for SQL Server
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post [12.4.474 Pro] - BUG: $CURRENT(...) broken for SQL Server Reply with quote
The upgrade to 12.4 has caused massive damage to some of my snippets using the $CURRENT(...)$ macro. I have a snippet that I use to add aliases (and then alter them) quickly. Its code is this:
Code:

AS [$CURRENT(param1, names_only, dont_replace)$]


In the past, when I typed its trigger, this snippet did the following: fetch the first name left from the cursor (after removing the trigger word), add the AS keyword after that name, and copy the name (enclosed within delimiters) after the AS. Quite simple, worked like a charm.

After the upgrade, it behaved oddly, so I checked how it performed now. It turned out, not good at all. I've created a simple scenario with the following three lines, each containing 9 names:
Code:

name1, name2, name3, name4, name5, name6, name7, name8, name9
[name1], [name2], [name3], [name4], [name5], [name6], [name7], [name8], [name9]
([name1], [name2], [name3], [name4], [name5], [name6], [name7], [name8], [name9])


Typing the trigger word at the end of each line should have turned them into this:
Code:

name1, name2, name3, name4, name5, name6, name7, name8, name9 AS [name9]
[name1], [name2], [name3], [name4], [name5], [name6], [name7], [name8], [name9] AS [name9]
([name1], [name2], [name3], [name4], [name5], [name6], [name7], [name8], [name9]) AS [name9]


Instead, what I got was this:
Code:

name1, name2, name3, name4, name5, name6, name7, name8, name9 AS [name4]
[name1], [name2], [name3], [name4], [name5], [name6], [name7], [name8], [name9] AS [[name4]]
([name1], [name2], [name3], [name4], [name5], [name6], [name7], [name8], [name9]) AS [[name4]]


Just out of curiosity, I've modified the snippet (removed the names_only part):
Code:

AS [$CURRENT(param1, dont_replace)$]


This produced a different, but similarly bad result for the above three lines:
Code:

name1, name2, name3, name4, name5, name6, name7, name8, name9 AS [,]
[name1], [name2], [name3], [name4], [name5], [name6], [name7], [name8], [name9] AS [,]
([name1], [name2], [name3], [name4], [name5], [name6], [name7], [name8], [name9]) AS [name7]


Any idea why this is happening?
Thu Oct 12, 2023 10:45 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
There was an enhancement added in 12.4 to enable more granular selection of what's in scope for current selection, like only letterrs, only numbers, and so on, but what I see in your examples is nothing like that and can't be explained. Please allow us some time to investigate.
Thu Oct 12, 2023 1:27 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
Let me know if I can help in any way.

Meanwhile, I've got a few questions. What exactly is the difference in the new options? I've requested this feature enhancement and the reason behind it was that the snippet was originally using the "word" option and in case the caret was positioned like this (pipe indicates the cursor):
Code:

my_identifier_name|,

the option "word" had a rather unpleasant side effect of choosing the comma as 'victim' instead of going for 'my_identifier_name'.
Code:

my_identifier_name[,]|


This led me to change the snippet to use 'param1' which had its own issues, but at least it kinda worked. Until now. So now I changed it back to 'word' in the hope it would mean lower and uppercase letters, numbers, and the underscore (perhaps even the $ character if I'm lucky), which usually happen to be in words in the coding world, and it would exclude all the rest of the characters, symbols, like the brackets, operators and whatsoever. But it only went back to the old way of the macro not recognizing the identifier (actual word) right in front of its nose and again, it nailed the comma instead. After this, I tried changing it to "Letters+Digits" and it almost worked. Sadly, that's exactly what it says on the tin: letters and digits, underscore (and the $ definitely) not included. It tosses the comma "right" aside in situations like the above and leans towards the "left" instead, but as soon as it runs into an underscore, it slays the original identifier right there. The result:
Code:

my_identifier_[name]|,


Just out of curiosity, I've tried 'Symbols' but that one inserted the same $CURRENT(alphanumeric)$ into the snippet code just as "Letters+Digits" would. Are those two meant to be exactly the same?
Fri Oct 13, 2023 5:44 am View user's profile Send private message
Mindflux



Joined: 25 May 2013
Posts: 812
Country: United States

Post Reply with quote
While this topic is being discussed, was the documentation for $CURRENT not updated to reflect these new options? I see the new options in the macro assistant but no mention in the documentation (pdf)
Fri Oct 13, 2023 10:32 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
We are testing a fix for the above issue. The user's guide update for new parameters added in 12.4 for $CURRENT$ is in progress and expected to be ready soon too.
Tue Oct 17, 2023 9:07 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
@gemisigo
Last week we emailed you a fix to test with your snippets dependent on the $CURRENT$. Please let us know if fixed know issues.
Mon Oct 23, 2023 4:12 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
I'm sorry for the delay and thank you very much for the follow-up, I haven't noticed that email somehow ended up in the trash.

The fix is excellent!
Mon Oct 23, 2023 7:24 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
Thank you so much for testing. Glad it's fixed. Emails with download links sometimes go straight to junk or other wrong folder, which is not uncommon. That's why we added a note here as well.
Mon Oct 23, 2023 8:31 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.