SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Feature request : Code Structure View filter

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Feature request : Code Structure View filter
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 1402

Post Feature request : Code Structure View filter Reply with quote
While it is extremely useful to load bookmarks from the editor itself, it is limited to 10 bookmarks altogether. On the other hand, Code Structure View can be overly verbose sometimes. It would be nice if it was possible to filter its entries eg. only show lines containing 'PRINT' or 'CREATE' or 'CREATE TABLE' and so on.
Sun Sep 30, 2012 1:14 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6513

Post Reply with quote
Thank you for your feedback. I will submit it for further evaluation.

Are you aware that you can have more then 10 bookmarks by using specially formatted bookmark comments with can be also saved with the code?
Mon Oct 01, 2012 9:33 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1402

Post Reply with quote
I'm not sure. Are you referring to '[bookmark]' tags? I tried adding more than 10 entries (both '[bookmark]' and '[bookmark:n]') but only the first ten of them were turned into a bookmark and manually adding more of them resulted in first one being replaced. Is there another method?
Mon Oct 01, 2012 12:56 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1402

Post Re: Feature request : Code Structure View filter Reply with quote
gemisigo wrote:
While it is extremely useful to load bookmarks from the editor itself, it is limited to 10 bookmarks altogether. On the other hand, Code Structure View can be overly verbose sometimes. It would be nice if it was possible to filter its entries eg. only show lines containing 'PRINT' or 'CREATE' or 'CREATE TABLE' and so on.


Is the filter for Code Structure View going to be implemented? Not being able to filter its content makes its use rather limited.
Tue Aug 12, 2014 11:35 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6513

Post Reply with quote
Quote:
Is the filter for Code Structure View going to be implemented? Not being able to filter its content makes its use rather limited.

I'm not sure, I don't see that in the queue for 7.x maintenance releases.

What do you think about using code folding in SQL Assistant Code Editor? Can you collapse unneeded parts of the code, instead of filtering code structure?
Tue Aug 12, 2014 2:56 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1402

Post Reply with quote
SysOp wrote:

I'm not sure, I don't see that in the queue for 7.x maintenance releases.

What do you think about using code folding in SQL Assistant Code Editor? Can you collapse unneeded parts of the code, instead of filtering code structure?


I think that they are built for somewhat different purposes. Code folding is good for focusing on a certain part of the code, while Code Structure View is primarily for looking for that part to focus to. I use code folding provided by SQL Editor rarely. It's pretty useful when I edit small parts scripts for long time but there are quite a few things which make it severely inferior to Code Structure View when it comes to looking for some specific part of the code.

1. It is available in SQL Editor only
2. It requires folding/unfolding parts of the script manually.
3. You still have to skim through the text using either built-in basic human "naked-eye" feature, prone to miss matches and false alarms, or the search/replace feature included in SQL Editor, which in turn tends to find words that are in folded sections but does not unfold them. It simply puts the cursor to the next unfolded line after the section the word was found.
4. It break's Bird's View. Er... It slaughters it. Really. Try Full collapse and then open Bird's View. It will act weird.

On the other hand, filtering Code Structure View can narrow the list of to flip through AND bring you there with a single mouse-click. Without filter (or some other mean to search in it, but I'd prefer a filter there) it's missing potential. A great deal of it, I must say.
Wed Aug 13, 2014 4:09 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1402

Post Reply with quote
I still miss the ability to filter in Code Structure View dearly after upgrading to SA 7.5.492. Also, while Structure View has a button in top right corner for refresh, Bird's View does not, it can only be refreshed by a hotkey (F5) or using the context menu. Is this intentional?
Thu Feb 11, 2016 6:59 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6513

Post Reply with quote
Adding a filter to the Code Structure View sounds like a very good idea to me. I'm going to submit your suggestion as an enhancement.
The Bird's Eye View is quite different, it relies on the graphical interface to capture screenshots of code pages, and it refreshes when you scroll the editor or make changes in the code. One quick way to refresh it is to drag the vertical scroll-bar's thumb all the way to the end of the code and then back.
Thu Feb 11, 2016 8:47 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1402

Post Reply with quote
Thank you very much.

Regarding the Bird's View, what I was referring to is that it misses the obvious button other views have. Check the screenshots below


Structure View


Bird's View
Thu Feb 11, 2016 9:00 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6513

Post Reply with quote
I understood that correctly. There is no internal refresh mechanism available for that view, that's why the button is hidden. The refreshes are triggered by screen repainting, in other words, when you do something with your editor. It's a different kind of animal if I may call it that way.

To see what I mean, highlight a portion of the text within the editor while Bird's View is open and showing the current page. You will see that the miniature reflection of that rendered in the page thumbnail within the Bird's View. It's a copy of your screen.
Thu Feb 11, 2016 10:17 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1402

Post Reply with quote
I understand that its refresh is triggered. What I don't understand is that if it lacks that button for that reason, why does it still have a hotkey and a context menu item to force it refresh. Or to get to it from the other way around, if it we still have the option to manually refresh it, why bother removing the button?



Thu Feb 11, 2016 11:19 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6513

Post Reply with quote
I have a question about your Code Structure View filter. How do you see it working? For example, if you have CREATE PROCEDURE ... BEGIN...END statement in the editor, in the structure view it is represented by a top level collapsible item CREATE PROCEDURE..., and then you filter on an object name referenced within that procedure code, what do you expect to see in the structure view when the filter is applied?
Wed Feb 17, 2016 12:29 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1402

Post Reply with quote
What I had in mind was rather straightforward and simple. As far as I understand the Code Structure View fetches the first row from every statement and shows it in a list in the view and applies the hierarchy so that it can accomplish folding.
Now, if I have the following code in editor

Code:


-------------------------------------------------------------------------------------- PROCEDURE : dbo.usp_aoeuaoeu --- --
IF object_id('dbo.usp_aoeuaoeu', N'P') IS NULL
BEGIN
    PRINT 'CREATE DUMMY PROCEDURE dbo.usp_aoeuaoeu';
    EXEC('CREATE PROCEDURE dbo.usp_aoeuaoeu AS BEGIN SET NOCOUNT ON; END');
    IF @@ERROR = 0
        BEGIN
            PRINT 'DUMMY PROCEDURE dbo.usp_aoeuaoeu created';
            EXEC sys.sp_addextendedproperty @name = N'MS_Description', @value = N'<<purp_desc>>', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'procedure', @level1name = N'usp_aoeuaoeu';
        END;
END;
go
--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PROCEDURE : dbo.usp_aoeuaoeu +++ --

ALTER PROCEDURE dbo.usp_aoeuaoeu
(
    @debug INT = NULL
) -- WITH RECOMPILE
AS
BEGIN

    IF @debug > 0 SET NOCOUNT OFF ELSE SET NOCOUNT ON;
   
    DECLARE @log AS TABLE (id_log INT NOT NULL IDENTITY(1,1) PRIMARY KEY, log_entry NVARCHAR(MAX), log_entry_int BIGINT, entry_date DATETIME2(7) DEFAULT sysdatetime());
    DECLARE @now TIME(7) = SYSDATETIME(), @roco INT;
   
    /* crap starts here */
   
    SELECT 1 AS dummy_column;
   
    /* crap ends here */    
   
    IF @debug > 0 SELECT * FROM @log AS l;
    RETURN @@ERROR;
END
GO

GO
IF @@ERROR = 0
BEGIN
    print 'PROCEDURE created : dbo.usp_aoeuaoeu';
END
--==================================================================================== PROCEDURE : dbo.usp_aoeuaoeu === --
go

the View consists of the following three lines (folded):
Quote:

IF object_id('dbo.usp_aoeuaoeu', N'P') IS NULL
ALTER PROCEDURE dbo.usp_aoeuaoeu
IF @@ERROR = 0

Unfolding reveals the rest of the hierarchy. I imagine that maintaining the hierarchy after applying the filter could prove almost impossible and I thought it could be powerful enough in its most simple form. Having a filter in effect would remove hierarchy (expand all and remove level distinction) and only show items that contain the filter text (using Name Matching method if that's possible to implement). That is, entering the word 'usp_aoeuaoeu' would keep the 7 rows (where that string occurs) in the view but typing 'ALTER PROCEDURE' would only keep that one.
Wed Feb 17, 2016 4: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
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.