Problem with generics
Superb script really great, however it seems to fail on generics.
private List<String> foo;
getset won't generate methods for this field.
private List foo;
but it will when generics are removed. --January 16, 2012
- A quick hack to support generics:
- Open your java_getset.vim file
- Search for definition of s:variable (i.e. let s:variable = ......)
- Before that line add a new definition: let s:generics = '\%(\s*\%(<.*>\)\)\='
- Change the definition of s:variable to (see underlined part): let s:variable = '\(\s*\)\(\(' . s:modifier . '\s\+\)*\)\(' . s:javaname . s:generics . '\)' . s:brackets . '\s\+\(' . s:javaname . '\)\s*\(;\|=[^;]\+;\)'
- What this does is it extends the regular expression matching the field definitions by adding "<...>" to the type part. Actually it does not check for what's inside the angle brackets and since allowing for multi-type generics and nested generics, too.
- (As with the nature of quick hacks this one does not fix the javadoc creation where angle brackets will still appear as angle brackets instead of HTML-code.)
- --February 27, 2012