add action to run erl_tidy
on current file and on current project
can we show the compare editor with the 'before' and 'after'?
can we show the compare editor with the 'before' and 'after'?
Leave a comment
on 2009-12-14 19:40 *
By AlainODea
Assigned to set to AlainODea
Status changed from New to Accepted
Work remaining set to 8.0
Assigned to set to AlainODea
Status changed from New to Accepted
Work remaining set to 8.0
I have a decent grasp of running erl_tidy itself and use many similar Eclipse features on a day to day basis in Java Development. I think I can make this work.
on 2009-12-15 05:20 *
By Vlad Dumitrescu
Milestone changed from backlog to 0.8
Milestone changed from backlog to 0.8
on 2009-12-15 06:21 *
By Vlad Dumitrescu
We can add that later, the important thing is that we can run it somehow.
Can you add a ticket for "erl_tidy be a save action", Jakob?
Can you add a ticket for "erl_tidy be a save action", Jakob?
I will be refactoring this feature to use erl_tidy:forms instead as Vlad has suggested. The resource of an ErlangEditor in Eclipse may not be backed on a local file or on a file at all. This makes the current implementation brittle. The current implementation also has issues with edited or out of sync files on Windows. Hopefully running the resource edits within Eclipse should resolve both of these weaknesses in the current implementation.
Vlad's suggestion is to use the ErlIDE scanner and feed the syntax token representation to erl_parse to get the abstract forms which erl_tidy:forms can use:
Vlad's suggestion is to use the ErlIDE scanner and feed the syntax token representation to erl_parse to get the abstract forms which erl_tidy:forms can use:
One could have an editor open on a resource that is
not a file. The operation should call erl_tidy:module and use the
parsed representation of whatever is in the editor. The model we use
doesn't parse the whole file, but you can retrieve the scanned tokens
(erlide_scanner_server:getTokens), feed them to erl_parse:parse and
the result to erl_tidy:forms. The name used for the module in Erlang
is
scannerName = ErlangToolkit.createScannerModuleName(module);
Made a number of runs at using erlide_scanner_server:getTokens/1 as a source of data for erl_tidy:module/1 without luck. I cannot seem to convert the output of erlide_scanner_server:getTokens/1 into a format acceptable to erl_parse:parse_forms/1. It looks fine on visual inspection but erl_parse:parse_forms/1 always returns something like:
It looks like erl_tidy solves this problem by somehow ignoring comments, but its not clear to me. I will try again in a couple of days. I am unable to work on this tomorrow evening unfortunately.
{error,{"%%%-------------------------------------------------------------------",erl_parse,["syntax error before: ","comment"]}}
It looks like erl_tidy solves this problem by somehow ignoring comments, but its not clear to me. I will try again in a couple of days. I am unable to work on this tomorrow evening unfortunately.
I hope you're aware of the different token formats: erlide uses a records #token{} (defined in erlide_scanner.hrl), and syntax_tools uses the tuple format. A lot of functions in erl_syntax will have to be rewritten.
There are also a lot of things missing in syntax_tools, it seems to be one of those applications that are included in OTP, but never really used or supported...
There are also a lot of things missing in syntax_tools, it seems to be one of those applications that are included in OTP, but never really used or supported...
on 2009-12-17 04:07 *
By Vlad Dumitrescu
Did you use erlide_scan:filter_comments and filter_ws and possibly even filter1?
on 2010-01-14 08:39 *
By Vlad Dumitrescu
Related association with ticket #508 was added
on 2010-01-14 08:40 *
By Vlad Dumitrescu
Category changed from Bug to New feature
Milestone changed from 0.8 to planned work
Category changed from Bug to New feature
Milestone changed from 0.8 to planned work
moved to 'planned work' -- has to be reactivated when we have a pretty-printer (#508)
on 2010-04-13 08:25 *
By Vlad Dumitrescu
Status changed from Accepted to Test
Status changed from Accepted to Test
on 2010-09-08 03:48 *
By Vlad Dumitrescu
Milestone changed from backlog to after v1.0
Milestone changed from backlog to after v1.0
Updating tickets (#130, #223, #235, #276, #325, #438, #580, #53, #58, #116, #117, #121, #164, #170, #211, #234, #238, #239, #244, #252, #255, #328, #374, #377, #378, #392, #394, #407, #410, #447, #459, #491, #496, #508, #524, #545, #576, #590, #205, #240, #493, #495, #514, #515, #517, #557, #589, #62, #99, #118, #359, #437, #445, #498, #499)
on 2010-12-23 08:43 *
By Vlad Dumitrescu
Updating tickets (#106, #113, #129, #130, #182, #223, #235, #276, #325, #438, #483, #529, #580, #40, #42, #43, #44, #46, #53, #58, #61, #69, #76, #80, #84, #89, #115, #116, #117, #119, #121, #123, #152, #164, #166, #168, #169, #170, #176, #188, #199, #208, #211, #216, #231, #234, #237, #238, #239, #244, #249, #252, #255, #264, #291, #294, #313, #314, #317, #321, #323, #326, #328, #336, #366, #374, #377, #378, #380, #392, #394, #398, #407, #410, #430, #440, #447, #459, #463, #465, #477, #478, #485, #491, #494, #496, #508, #511, #524, #530, #545, #560, #565, #569, #570, #576, #584, #590, #594, #596, #620, #621, #100, #160, #205, #240, #265, #436, #439, #452, #475, #493, #495, #506, #514, #515, #517, #536, #548, #557, #589, #600, #62, #99, #118, #132, #145, #210, #359, #387, #419, #433, #437, #445, #488, #498, #499)
on 2011-03-07 04:31 *
By Vlad Dumitrescu
Assigned to changed from AlainODea to -none-
Assigned to changed from AlainODea to -none-
I have included this in 'pu', but the commands are disabled. This is so that i don't have to keep rebasing the branch.