#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 Changed 11 years ago by Jpm
comment:2 Changed 11 years ago by mlipok
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 Changed 11 years ago by Jos
- Resolution set to No Bug
- Status changed from new to closed
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
Guidelines for posting comments:
- You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
- In-depth discussions should take place on the forum.
For more information see the full version of the ticket guidelines here.
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