 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
$CURRENT_SEL$ macro seems to be broken |
|
I have the following macro, triggered with Alt+0:
 |
 |
SELECT
sq|
FROM
(
$CURRENT_SEL$
) AS sq
|
Now, when I try to apply that to a selected query, let's say this one:
 |
 |
SELECT COUNT(1) AS c FROM sys.databases AS d |
the expected result would be
 |
 |
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:
 |
 |
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:
 |
 |
SELECT
COUNT(1) AS c
FROM
sys.databases AS d
|
Result:
 |
 |
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
Target editor and environment info
 |
 |
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:
 |
 |
-- 1
-- 2
-- 3
-- 4
-- 5
$CURRENT_SEL$
-- 6
-- 7
-- 8
-- 9
-- a
|
Original query:
 |
 |
SELECT
COUNT(1) AS c
FROM
sys.databases AS d
|
After transformation:
 |
 |
-- 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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
 |
 |
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.
 |
 |
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 |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
Any news on this?
|
|
Mon Jun 04, 2012 4:16 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Yes. Fixed. Please wait 1 more day :-)
|
|
Mon Jun 04, 2012 9:23 am |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
Certainly :) Lots of good news today :D
|
|
Mon Jun 04, 2012 2:26 pm |
|
 |
|
|
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
|
|
|