| Summary: | "Fix Copyrights" should be able to automatically run on file save | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Ben Fritz <fritzophrenic> | ||||
| Component: | Releng | Assignee: | Platform-Releng-Inbox <platform-releng-inbox> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | enhancement | ||||||
| Priority: | P3 | CC: | akurtakov, david_williams, nikolaymetchev | ||||
| Version: | 4.2 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Ben Fritz
I was thinking the same. I'll see if I can do this. Hey ya, I spent a couple of days looking into this. I got it working as far as having a 'Copyright fix' listed under Eclipse's save action. (see screenshots in zip). (based on tutorial: http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.jdt.doc.isv%2Fguide%2Fjdt_api_contributing_a_cleanup.htm) However, then I noticed that Eclipse's Save-Actions work with the source code AST (Abstract Syntax Tree) where as Copyright_tool works on files directly. I.e, the architectures aren't quite compatible with one another. This generates issues, e.g one loses git-integration because you no longer work with files. But even if the git issue is ignored, implementing this feature would require one to duplicate the copyright-tool logic and work separately on the AST instead of files. (i.e, one can't pass the file to the existing code easily). This is quite a big task and would require a big alteration in copyright tool. Unfortunately I won't have time to work on this anymore. But if someone wishes to pursue this, I"m attaching a test project with what I got so far. An alternative direction would be to intercept the save-command itself, and run the tool on the file after the save is complete. (and add a checkbox in the Copyright tool options. ) (as in: http://stackoverflow.com/questions/5899738/override-eclipse-file-save-action) Created attachment 246439 [details]
started save-action
Copyright tool is no longer developed. |