How to tell Velocity parser about variables defined in VelocityContext?

All templates in my code generation system depend on entity diagram object
model which is supplied to the templates via VelocityContext. Intellij have
no way of knowing of this variables and mark them all and all their property
access as errors (Can't resolve property of ...)

Is there any way to provide velocity parser with name/class pairs so it
would recognize all names defined in velocity context?

thanks

alex


3 comments
Comment actions Permalink

Oh, found it

"Alex Roytman" <nospam@domain.com> wrote in message
news:g9v7hr$b96$1@is.intellij.net...

All templates in my code generation system depend on entity diagram object
model which is supplied to the templates via VelocityContext. Intellij
have no way of knowing of this variables and mark them all and all their
property access as errors (Can't resolve property of ...)

>

Is there any way to provide velocity parser with name/class pairs so it
would recognize all names defined in velocity context?

>

thanks

>

alex



0
Comment actions Permalink

Not that I am currently interested in the answer, but I do occasionally work
with Velocity.
It used to be part of the netiquete to name the solution even if you figured
it out yourself...

Alex Roytman wrote:

Oh, found it

"Alex Roytman" <nospam@domain.com> wrote in message
news:g9v7hr$b96$1@is.intellij.net...

>> All templates in my code generation system depend on entity diagram object
>> model which is supplied to the templates via VelocityContext. Intellij
>> have no way of knowing of this variables and mark them all and all their
>> property access as errors (Can't resolve property of ...)
>>
>> Is there any way to provide velocity parser with name/class pairs so it
>> would recognize all names defined in velocity context?
>>
>> thanks
>>
>> alex
>>


0
Comment actions Permalink

Sure, it was so simple and I did not posted it.
Basically when you move cursor over missing variable, it will suggest adding
defining it in comment or external file
It also is capable of doing the same with macros very nice

What is missing in my opinion is to be able to define variable property
types where known superclasses are returned. As it stands now any property
which can not be checked against getter return class marked as invalid. I
would like in some cases specify this getter actual return class.

For example I have a code generator where decorator pattern is used heavily
and depending on type of code generated there will be lots of extra
properties in each class. So $model.tables (List) in case of JDO generation will return collection of JdoTable which has much more properties than basic Table which IDEA uses for property validation Alex "Stephen Friedrich" ]]> wrote in message
news:ga0h8b$4oe$1@is.intellij.net...

Not that I am currently interested in the answer, but I do occasionally
work
with Velocity.
It used to be part of the netiquete to name the solution even if you
figured
it out yourself...

>

Alex Roytman wrote:

>> Oh, found it
>>
>> "Alex Roytman" <nospam@domain.com> wrote in message
>> news:g9v7hr$b96$1@is.intellij.net...
>>> All templates in my code generation system depend on entity diagram
>>> object model which is supplied to the templates via VelocityContext.
>>> Intellij have no way of knowing of this variables and mark them all and
>>> all their property access as errors (Can't resolve property of ...)
>>>
>>> Is there any way to provide velocity parser with name/class pairs so it
>>> would recognize all names defined in velocity context?
>>>
>>> thanks
>>>
>>> alex
>>>
>>

0

Please sign in to leave a comment.