SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
$CURRENT_SEL$ macro seems to be broken

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
$CURRENT_SEL$ macro seems to be broken
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post $CURRENT_SEL$ macro seems to be broken Reply with quote
I have the following macro, triggered with Alt+0:
Code:

SELECT
   sq|
FROM
   (
      $CURRENT_SEL$
   ) AS sq


Now, when I try to apply that to a selected query, let's say this one:
Code:
SELECT COUNT(1) AS c FROM sys.databases AS d

the expected result would be
Code:

SELECT
   sq|| <-cursor blinking here
FROM
   (
      SELECT COUNT(1) AS c FROM sys.databases AS d
   ) AS sq


But instead of that I get this:
Code:

SELECT
SELECT COUNT(1) AS c FROM sys.databases AS d   |<-cursor blinking here
   sq
SELECT COUNT(1) AS c FROM sys.databases AS d
FROM
SELECT COUNT(1) AS c FROM sys.databases AS d
   (
SELECT COUNT(1) AS c FROM sys.databases AS d
      SELECT COUNT(1) AS c FROM sys.databases AS d
SELECT COUNT(1) AS c FROM sys.databases AS d
   ) AS sq


Having selected multiple lines yields a total mess:
Source:
Code:

SELECT
   COUNT(1) AS c
FROM
   sys.databases AS d


Result:
Code:

SELECT
SELECT
   sq
SELECT
FROM
SELECT
   (
SELECT
      SELECT
   COUNT(1) AS c
FROM
   sys.databases AS d
SELECT
   ) AS sq


SA version 6.2.77
Wed May 16, 2012 7:15 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
I failed to reproduce this issue. Which target editor and version are you using?

Can you reproduce the issue when using right-click menu -> SQL Assistant -> Code Snippets -> [Select the same snippet from Code Snippets menu]?
Wed May 16, 2012 9:25 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
Target editor and environment info

Quote:
Microsoft SQL Server Management Studio 10.50.2500.0
Microsoft Analysis Services Client Tools 10.50.2500.0
Microsoft Data Access Components (MDAC) 6.1.7601.17514
Microsoft MSXML 3.0 5.0 6.0
Microsoft Internet Explorer 9.0.8112.16421
Microsoft .NET Framework 2.0.50727.5456
Operating System 6.1.7601


It works properly both from context and main menus, triggering it with Alt + number causes problems.

EDIT: I made a few tests and this is what I got:
Snippet:
Code:

-- 1
-- 2
-- 3
-- 4
-- 5
$CURRENT_SEL$
-- 6
-- 7
-- 8
-- 9
-- a


Original query:
Code:

SELECT
   COUNT(1) AS c
FROM
   sys.databases AS d   


After transformation:
Code:

-- 1
SELECT
-- 2
SELECT
-- 3
SELECT
-- 4
SELECT
-- 5
SELECT
SELECT
   COUNT(1) AS c
FROM
   sys.databases AS d   
SELECT
-- 6
SELECT
-- 7
SELECT
-- 8
SELECT
-- 9
SELECT
-- a



Other snippets having a single line statement containing $CURRENT_SEL$ operate normally. Multiline snippets are broken.
Any ideas?
Wed May 16, 2012 9:37 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
That seems to happen only when using Alt+number hot keys. I wonder if such hot keys conflict with hot keys for setting and manipulating code bookmarks.

PS. I tried your latest code snippet version and it's working well for me when I'm using menus.
Wed May 16, 2012 11:17 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
SysOp wrote:
That seems to happen only when using Alt+number hot keys. I wonder if such hot keys conflict with hot keys for setting and manipulating code bookmarks.

I removed hotkeys for code bookmarks but that did not help.

SysOp wrote:
PS. I tried your latest code snippet version and it's working well for me when I'm using menus.

Invoking the snippet from menus works fine but the previous versions did not have this issue. Three of my Alt+Num snippets utilize $CURRENT_SEL$ macro and I used them pretty frequently in the past. All of them are broken now.
Wed May 16, 2012 12:55 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
Any news on this?
Mon Jun 04, 2012 4:16 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
Yes. Fixed. Please wait 1 more day :-)
Mon Jun 04, 2012 9:23 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
Certainly :) Lots of good news today :D
Mon Jun 04, 2012 2:26 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.