How to check if a function or procedure is private, protected or public without scrolling to the top

Is it possible to find out if a function or procedure is private, protected, or public. Now I have to scroll up to see if the method is private. Is there a tool or in the framework (Code Explorer) to see if a method is private, protected or public scrolling up.

Example:

 unit .....
 // 100 line code
 private
 // 1000 line code
   procedure A(); // <-- Here I can't see if the procedure is private. Must scroll to the top
 //  2000 line code 
 ...
 procedure A();  // <-- Here I can't see if the procedure is private. Must scroll to the top
 begin
   ...
 end;

      

The only thing I can do now is install (private, protected or public) its short description

In Code Explorer, I see a blue for a procedure and green for a function, but nothing for a private, protected, or public icon.

I changed the properties of the Explore code and now I have private, protected or burst maps.

But when I go to the procedure in code, there is no selected item in the exploration code like there is in the Project Manager view. The same situation is for the research code. You must scroll down to the map to see if it is private, protected, or public. One option is to record a method in the search for code under study. Then ther is the tooltip.

I found a possible solution: copy the method and went to the explorer code search bar. The comboboxlist popup gives me what I want to see (closed, protected ...)

+3


source to share


4 answers


Use Structure View to show all the details about class declarations.

To control the appearance of the view, define the settings in the dialog box Tools > Options > Environment Options > Explorer

.




Update

As noted in the comments, you need to manually navigate to the structure view to view the structure of the class.

Improvement Request filed QC 128271 Finding the structure view from the editor to make it easier to quickly view the structure view from the editor.

+5


source


... without scrolling up

Use the keyboard shortcut CTRL- SHIFT- UP(or CTRL- SHIFT- DOWN) to navigate to the ad.



And use the same to get back to implementation again.

If it's not clear to which section (private, protected, or public) the ad belongs immediately, use CTRL- UPto scroll without moving the cursor.

+3


source


I can recommend ModelMaker Code Explorer . It's not free, but it costs money. It shows a lot of information and provides some really useful refactorings.

+1


source


No, you cannot. because Delphi splits its classes into two interfaces and pices.

In fx. C # you do this different

public static byte[] ColumnBlob(Sqlite3Statement stmt, int index)
{
    return Sqlite3.sqlite3_column_blob(stmt, index);
}

      

In Delphi, you spilled a class on thw:

type 
   TSQLiteException  = class(TException)
   public
     class function  ColumnBlob(stmt : Sqlite3Statement, index : integer) : TArray<byte>;
   end;

      

and implantation:

function TSQLiteException.ColumnBlob(stmt : Sqlite3Statement, index : integer) : TArray<byte> ;
begin
  //Do stuff
end;

      

There are ups and downs in both methods:

C # you can see the protection level of a class while you cannot see which class you are working with in

And everything is fine with Delphi

0


source







All Articles