SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[7.0.132 beta] FR - Pre-format queries prior pasting

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[7.0.132 beta] FR - Pre-format queries prior pasting
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2165

Post [7.0.132 beta] FR - Pre-format queries prior pasting Reply with quote
When building the query to be pasted (either by a snippet or by selecting objects from popup lists for different keywords such as SELECT, UPDATE, INSERT, etc.) SA should pre-format query according the active formatting rules prior pasting the result into the editor. This could save us the time and effort applying the formatting rules manually by of selecting the pasted text and pressing ctrl+F11 (or whichever hotkey is set for that feature).
Fri Jul 04, 2014 4:38 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Reply with quote
It sounds like you want an option for snippets to format the dynamically generated code from snippet before inserting it into the editor? Am I right?
Fri Jul 04, 2014 11:14 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2165

Post Reply with quote
SysOp wrote:
It sounds like you want an option for snippets to format the dynamically generated code from snippet before inserting it into the editor? Am I right?


Well… yes, and no. Not only the code generated by snippets but those generated otherwise as well. When I select a table/view/whatever or a number of its columns after a keyword (SELECT, UPDATE, etc.) code is generated and it is formatted but not using the rules I defined. I'd like all code generated by SA to be preformatted according my redefined rules, not just out of blue. Conditionally, of course, there should be an option for this to turn on/off.
Fri Jul 04, 2014 11:48 am View user's profile Send private message
sqltogo



Joined: 02 Jul 2014
Posts: 38
Country: Netherlands

Post Reply with quote
Although formatting is easy using Ctrl+F11, it sure is a good option to add to SA.
Fri Jul 04, 2014 3:24 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2165

Post Reply with quote
sqltogo wrote:
Although formatting is easy using Ctrl+F11, it sure is a good option to add to SA.


It's not about simple formatting. Pressing Ctrl+F11 will format the whole content of the editor. You could, of course, select the newly inserted part and then press Ctrl+ F11 but the inserted part might occupy half of the screen or more for larger tables/views (I've got snippets that insert tens of thousands of characters spanning over several screens) and then selecting the fresh code fragment might not be that easy. Often the new script is inserted into a structure already several levels deep and formatted and applying formatting to the whole might be undesired (eg. it's formatted differently). Reminded me to another feature request I wanted to post :)
Fri Jul 04, 2014 4:21 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Reply with quote
There are a few technical difficulties with formatting code inserted from standard popups because "Pre-format queries prior pasting" does't work as described. Many popups insert code while interacting with the user, for example, when you use columns popup, you can select and deselect columns as needed and they are added and removed from the code in the editor right away, there is no "final" code to paste. When the popup is closed, the code is already there.

The situation with snippets is a bit different. In most cases the code is inserted after the selection is processed, so it can be reformatted before pasting into the editor, and yet there are a few cases when it is inserted during the interaction just like in case of the columns popup.

We are studying this request, and looking at how and if it can be implemented, yet I cannot promise it will be implemented in the current incarnation of popup and snippet processing functions.


Last edited by SysOp on Mon Jul 07, 2014 8:10 am; edited 1 time in total
Sat Jul 05, 2014 12:48 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2165

Post Reply with quote
SysOp wrote:
There are a few technical difficulties with formatting code inserted from standard popups because "Pre-format queries prior pasting" does't work as described. Many popups insert code while interacting with the user, for example, when you use columns popup, you can select and deselect columns as needed and they are added and removed from the code in the editor right away, there is no "final" code to paste. When the popup is closed, the code is already there.


Yes, that's the main reason I already created custom snippets to accomplish that in a formatted way, though it was severely limited until the introduction of multi-select capable $OBJECTS$ macro. The built-in popup for SELECT is the only one I still use. Now that we have the new $OBJECTS$ I can select more than one column and I could use that to create my own snippet for SELECT as well but the formatting suffers again.

SysOp wrote:
We are studying this request, and looking at how and if it can be implemented, yet I cannot promise it will be implemented in the current incarnation of popup and snippet processing functions.


Never mind, formatting custom snippet result would be fine on its own. Thank you for your time and effort though.
Mon Jul 07, 2014 4:15 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Reply with quote
I have submitted an enhancement request for formatting custom snippet result using user selected formatting style. This way different styles can be used with different snippets
Mon Jul 07, 2014 8:13 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2165

Post Reply with quote
Thank you very much.
Mon Jul 07, 2014 8:21 am 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.