Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#2482 closed Bug (No Bug)

TIDY: #Tidy_Parameters=/sf issue

Reported by: mlipok Owned by: Jos
Milestone: Component: SciTE4AutoIt
Version: 3.3.9.21 Severity: None
Keywords: Cc:

Description

Version:
Tidy AutoIt3 v2.3.0.20 Copyright (c) Jos van der Zande September 18, 2013

example scipt:

#Tidy_Parameters=/sf
Func _test_1()
EndFunc   ;==>_test_1
;~ ##################
Func _test_2()
EndFunc   ;==>_test_2
;~ ##################
Func _test_3()
EndFunc   ;==>_test_3
;~ ##################
Func _test_4()
;~ ##################
EndFunc   ;==>_test_4
;~ ##################

For now, I can not prepare a better example, so I will use the above.


Description of issue:
Please try to use the example of TIDY
the result will be that:

#Tidy_Parameters=/sf
;~ ##################
Func _test_1()
EndFunc   ;==>_test_1
;~ ##################
Func _test_2()
EndFunc   ;==>_test_2
;~ ##################
Func _test_3()
EndFunc   ;==>_test_3
;~ ##################
Func _test_4()
;~ ##################
EndFunc   ;==>_test_4

As you can see TIDY moved the comment from the bottom to the top of the script.

This result, however, is not the worst.
It happened to me that TIDY removed or relocated, the last line that was not a comment but simply "EndFunc"

Which of course caused the scrypt contained significant error - the function declaration was not completely closed.

That, unfortunately, at the moment I can not reproduce, but I think it is related to the specified issue.

Attachments (0)

Change History (3)

comment:1 by J-Paul Mesnage, 12 years ago

Not sure what Tidy can do to between func comments.
It is true in your case it is moving the last line infront.

But what will happens if the func need to be reordered The mess will be bigger for the in between comments
just try

#Tidy_Parameters=/sf
;~ ########before 1##########
Func _test_1()
EndFunc   ;==>_test_1
;~ ########after 1##########
Func _test_4()
;~ ##################
EndFunc   ;==>_test_4
;~ #######after 4###########
Func _test_2()
EndFunc   ;==>_test_2
;~ #######after 2###########
Func _test_3()
EndFunc   ;==>_test_3
;~ #######after 3###########

comment:2 by mlipok, 12 years ago

I think the feature "comments moving" is developed to moving function description together with function.


ok
give me 1 month before closing this ticket

i try to reproduce case when TIDY cut the "EndFunc"

Then we can talk about the main problem.


In the meantime, if anyone sees a similar disturbing case, please include a description.

comment:3 by Jos, 12 years ago

Resolution: No Bug
Status: newclosed

This is not a bug. /SF works in the following way:

  • All Func 's are sorted in the correct sequence and placed at the end of the Script file.
  • All commentlines above the Func are considered to be part of the FUNC below it and sorted together with the FUNC.

So that means that the last comment line is actually the first regular codeline and hence will be at the top after sorting.

Jos

Last edited 12 years ago by Jos (previous) (diff)

Modify Ticket

Action
as closed The owner will remain Jos.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.