taqi/MonkeyCoder — Issue #5: FieldCodeSnippet refactor
Author: taqi
Created: 2012-01-21 21:09:06+00:00
State: open

Look at the FieldCodeSnippet.
As you can see, currently it works like simple Class field. But its not enough.
As for me, this class should generate more complex code, as now.
Currently it can generates something like
public String name;
But if we think little bit about fields, we can realize, that this is a part of more complex case - variable initialization.
public String name is almost the same as public String name = "name";
and String name = "my name";
So, as you can see, our snippet must work like expressions.

Steps to implement:
- look at the FieldCodeSnippet. Refactor it with new model - left part and right part.
- Make left part - check modificator, static flag, and type and make code generator for left part. (see AssignmentExpressionSnippet for examples.)
- Add tests to check right behavior with left part.
-Add right part, That should be CodeSnippet. (Or maybe ListCodeSnippet);
- Extends tests for left part that it can check the whole class.