SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
13. Auto-bookmarks from specially formatted script comments.
Goto page 1, 2  Next
 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
13. Auto-bookmarks from specially formatted script comments.
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 1394

Post 13. Auto-bookmarks from specially formatted script comments. Reply with quote
The screenshot for bookmark is very useful but is it possible to replace the numbers in the icons with arbitrary text when creating the bookmark using formatted comment? Something like:
Code:
 -- [bookmark:text to show])

Mon Jun 11, 2012 4:47 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6498

Post Reply with quote
I'm sorry I don't understand. The bookmark is a small floating circle that fits only 1 character and it's very small on purpose as not to obscure the work area. Where do you see user's specified bookmark text to show up? Or you want this text painted over the screenshot area? In the latest case, why not enter it in the comments near the bookmark marker?

Code:
-- My text here [bookmark] more of my text
-- even more of my text here



Last edited by SysOp on Tue Jun 12, 2012 10:44 am; edited 1 time in total
Mon Jun 11, 2012 5:50 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1394

Post Reply with quote
The numbers are good to show which hotkey does jump to the corresponding bookmark but other than that, they're mostly meaningless. Unless you can memorize to what part of the code they're assigned to, which is a bit hard when the number goes above 4 (at least for me it is). The extended comments you suggest are easily visible on screenshots and I've been using them in the past but when you've got nearly all 10 bookmarks in a script it's pretty cumbersome to hover the mouse above them to check them one by one.

What I'm thinking about is that it would be a nice touch if you could add the text after ':' in the "[bookmark:text here]" structure to the number in the floating circle (and make it a floating ellipse/box if it is necessary to fit) so that you can have both: the number and the text. You could give it a restriction to size to avoid covering large parts of the working screen area but I wouldn't bother doing so, I guess users can decide what's the best for them in this matter and won't use long texts if that obstructs them in work.

Of course, this would only affect bookmarks added through formatted comments, the regular ones added by clicking or using hotkeys could remain the same. You could even handle them separately. By having a bookmark structure like this users could easily and quickly create a clickable TOC to their code.

I suppose this wouldn't be a simple task to achieve and I'm not speaking for other users but I'd find it extremely useful. Consider it as a feature request ;) And let me know what do you think about it, please!
Tue Jun 12, 2012 4:46 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6498

Post Reply with quote
Thank you very much for your suggestions.

On a related subject, we are planning on implementing new Task List feature in the next maintenance release, which will provide new visual strip or pan with a list of bookmarks and to-do items found in the current file and other previously opened files and procedural objects. There users will be able to see them all at once, without a need to hoover over each circle. I guess a user-defined hot key will be available to show/hide the list with one key press.
Tue Jun 12, 2012 10:50 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1394

Post Reply with quote
That's even a better idea. Sounds very promising, I'm looking forward to it.
Tue Jun 12, 2012 2:14 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1394

Post Reply with quote
Any progress on this one? Is it still on your tasklist? :)
Tue Jul 08, 2014 3:16 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6498

Post Reply with quote
If I'm not missing anything, This is now part of Task and Reminders feature
Tue Jul 08, 2014 8:15 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1394

Post Reply with quote
Indeed. Time to put it under some real stress then :)

EDIT: This is intriguing. I really think Task and Reminders > Show deserves to have its own hotkey.

EDIT2: How should/does this thing work? I set up Source Folders. That worked properly. Then I set up Database Objects and clicked Update. It began scanning schemas and then stuck on one of them and I see no way to cancel it. I restarted the SQL Editor and now nothing happens when I click Update.

I also run into an obstacle. The list got populated on first run but when I double-click an item I get the following error message:
Quote:

The selected database object cannot be opened because it is located in a different database.


Before it got stuck I saw that it was scanning all the Database Objects, those on different Database Servers than the tab where the Task and Reminders was open was connected to. Imho, it should either open the object clicked in a new tab with a new connection or it should not scan those servers/objects it could not open anyway (preferred, since the list of the tasks is narrower and it's not very likely that one would bounce between servers frequently).

EDIT3: By the way, how do I clear that list? I removed the Database Objects so that only Source Folders remained but the items for Database Objects are still on the list.
Tue Jul 08, 2014 8:31 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6498

Post Reply with quote
Quote:
How should/does this thing work?


Task and Reminders is designed to monitor changed files in the user specified folders and changed database objects in the user specified databases and scan them for to-do marks and for bookmarks and show them in the Task and Reminders window so that you can jump to the code of the object or file with a simple double click. Of course for the initial load it needs to scan all files and all objects so that later it can only pick at the updated files and objects.

Quote:
The selected database object cannot be opened because it is located in a different database.

I will log this one, I'm not if that is by design or that is a bug.

Quote:
By the way, how do I clear that list

In the menu -> Tasks and Reminders -> Options dialog, select the folders you no longer want to monitor and delete them, there is little X icon above the list. Same goes for databases and database schemas.
Tue Jul 08, 2014 10:38 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1394

Post Reply with quote
SysOp wrote:

Task and Reminders is designed to monitor changed files in the user specified folders and changed database objects in the user specified databases and scan them for to-do marks and for bookmarks and show them in the Task and Reminders window so that you can jump to the code of the object or file with a simple double click. Of course for the initial load it needs to scan all files and all objects so that later it can only pick at the updated files and objects.


Thank you, that's clear now.

SysOp wrote:

I will log this one, I'm not if that is by design or that is a bug.


Thank you again.

SysOp wrote:

In the menu -> Tasks and Reminders -> Options dialog, select the folders you no longer want to monitor and delete them, there is little X icon above the list. Same goes for databases and database schemas.


Er... That's what I've done. But the objects remained on the result list. I can still see those objects the previous settings returned as having a todo or a bookmark in them, even after removing them from the objects to be monitored in Options and forcing an update from context menu.

By the way, I noticed that during the scan the object/file name that was being scanned was shown in the status bar. I had a hunch that it was executing the same query looking for some keywords in the body of object definition for each object selected. While this might be good for the progress bar to be more accurate I guess it's putting a rather large (and unnecessary) strain on the server that's doing the scan, one that might not be affordable on some servers (definitely not on production ones and alas, we don't always have the luxury to work on test servers :( ). Wouldn't it suffice to pass the list of the objects to the server to process the whole shebang in a single query instead of doing it one by one? Having dozens of servers and thousands of objects I reckon there would be a formidable drop in cpu/io/network traffic by doing so.
Wed Jul 09, 2014 2:55 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6498

Post Reply with quote
Quote:
Wouldn't it suffice to pass the list of the objects to the server to process the whole shebang in a single query instead of doing it one by one?


Unfortunately it needs to do it one-by-one, it extracts and parses code of each object looking for comments and then parsing comments. For now we don't have a way to run it on the server and then copy results to a local SA instance

By the way, I submitted an enhancement request to add commands to the menu to clear the list without erasing options and to run full refresh.


Last edited by SysOp on Wed Jul 09, 2014 8:46 am; edited 1 time in total
Wed Jul 09, 2014 8:15 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1394

Post Reply with quote
SysOp wrote:
By the way, I submitted an enhancement request to add commands to the menu to clear the list without erasing options and to run full refresh.

In fact, the problem is that the menu is not cleared at all, not even with every folder and object erased in Options.
Wed Jul 09, 2014 8:22 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1394

Post Reply with quote
SysOp wrote:

Unfortunately it needs to do it one-by-one, it extracts and parses code of each object looking for comments and then parsing comments. For now we don't have a way to run it on the server and then copy results to a local SA instance

Are you implying SA extracts the code of each and every object marked for monitoring, retrieves them from the server to the machine and then parses the retrieved text for comments instead of telling to server to build the list of objects that intersects the list of objects to be monitored and its definition is LIKE '%whatever_keywords_we_need%' and retrieve the code for those only for further parsing and processing the rest of it (populating the Task list)?
Wed Jul 09, 2014 8:34 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6498

Post Reply with quote
Sorry for the typo, yes, I meant "extracts" not "extras." Yes, it parses the code locally. It's not a simple search for a specific keyword. It needs to parse the code first to identify comments and then within extracted comments parse their text to find a number of variations of TO-DO like things ("TO-DO" and "to do:", etc...) and [bookmark:n] like things and memorize not just the fact of a presence of a certain word or test construct in an object, but also its exact position and surrounding text so that in the task list you can rtead that text, and when you dopuble-click it, it can jump to the exact location of that reference. In a nutshell, it's a complicated search and parse operation. To improve the efficiency, after the initial full scan, it only monitors objects recently modified - changed since the last scan. Such objects are identified by their last modification date time.
Wed Jul 09, 2014 8:55 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1394

Post Reply with quote
I see. I still think that the initial parsing is done on an unnecessarily large set of data. If the object definition is NOT LIKE '%to_do%' AND NOT LIKE '%[bookmark%' then there's no way a local search/parse could find a match for any variation of 'to do', 'to-do' & co. or for any variation of '[bookmark:n]', [bookmark] and the rest, regardless of there are comments or not. If there are many todos and bookmarks in the objects you'll have to fetch them anyway but if there are only a few and you're you're monitoring hundreds of objects, you're going to move a vast amount of data between the server and the SA client for naught. Applying just a small condition could be able prevent that.

On the other hand, only including the recently modified objects in check is a good approach.

By the way, I didn't notice that typo :)
Wed Jul 09, 2014 9:13 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
Goto page 1, 2  Next
Page 1 of 2

 
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.