Bug 92251 - BASIC IDE (Integrated Development Environment) Re-factoring facilities
Summary: BASIC IDE (Integrated Development Environment) Re-factoring facilities
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-22 12:05 UTC by Óvári
Modified: 2015-09-26 11:15 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Óvári 2015-06-22 12:05:59 UTC
Suggested enhancements for LibreOffice Basic IDE for macro editing is "Re-factoring facilities" (Renaming affects dependencies/Extract Method/Extract interface etc.).

Thank you
Comment 1 Cor Nouws 2015-06-22 13:59:07 UTC
Thanks Óvári - I set this as enhancement
Comment 2 Cor Nouws 2015-09-24 21:45:53 UTC
Hi Óvári,

hmm, could you give some more explanation - I seem to miss the clue now ;)
Comment 3 Óvári 2015-09-25 00:00:33 UTC
Hi Cor,

1. Thank you for your kind request. Perhaps my understanding of the definition of refactoring is incorrect. Hopefully the explicit examples below will help in what I was trying to suggest.

2. Refactoring is "the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure," according to Martin Fowler, the "father" of refactoring. cf. http://refactoring.com/.

3. [https://help.libreoffice.org/Basic/Using_Variables#Naming_Conventions_for_Variable_Identifiers Naming Conventions for Variable Identifiers] states that “In LibreOffice Basic variable identifiers are not case-sensitive”.

a) Once a variable is defined (eg with Dim statement), typing the variable later in the code will refactor (automatically change) to the variable case in the Dim statement.

   Having the statement:
     Dim myIntegerVariable As Integer
   And typing the following line
     myintegervariable = myintegervariable + 5
   Would change to
     myIntegerVariable = myIntegerVariable + 5

b) If the variable case is changed in the Dim statement, all references to the variable in the code will automatically refactor (update).

   In example shown in 3a, if the Dim statement is changed to:
     Dim MYiNTEGERvARIABLE As Integer
   the statements with that variable will automatically refactor:
     MYiNTEGERvARIABLE = MYiNTEGERvARIABLE + 5

4. Refactoring should also apply to constant names (eg Const statement).

5. Reserved words should also automatically refactor so writing the line:
     dim i as integer
   should automatically refactored to:
     Dim i As Integer

6. Refactoring should also apply to functions/methods/procedures.

7. Refactoring could also apply to code layout

a) code indenting

b) removable of multiple consecutive whitespaces

8. Please note that this is not an extensive explanation of refactoring, just some more explanation that you asked for.

Should you require any additional information, please advise.

Thank you
Comment 4 Cor Nouws 2015-09-25 15:32:11 UTC
Thanks Óvári for the extended explanation.
I must have been smoking strong stuff when setting this to new 

So problem one is that (reserved) names does not respect and enforce
cases. This looks as a enhancement request.
Wrt indents, I tend to think that it's more up to the habits of the
scripter?
Removing tailing spaces/tabs could be a nice tool, indeed.
..

Since we appreciate one issue for each problem, request/if you feel
clear on the other two, it would be my request to create them into
separate issues and then limit this issue (including the
description/summary) to the handling of case in names?

Cheers - Cor
Comment 5 Óvári 2015-09-26 11:15:25 UTC
Thank you Cor for your comment.

As you requested, separate issues have been created.  You have been attached to the CC list.

I have updated the status on this bug to resolved invalid. If this is incorrect, feel free to change it to the appropriate status.

Please advise if there is anything else that you require.

Thank you