Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] Extending the DLTK/JavaScript parser/model

Like alex already told you, that is perfectly doable in DLTK
we use it all over the place, because we have many many files on different scopes (so forms.xxxx reference in 1 file is pointing to an xxxxx.js file some where) orĀ  on the same scope
this can all be done by IMemberEvaluator
with IValueCollection getTopValueCollection(ITypeInfoContext context) you can return the complete top value collection (so all the files combined on the same scope)
and with IValueCollection valueOf(ITypeInfoContext context, Element member); you can tell dltk that for this element (like my forms.xxxxx above) that this element is really another file.

See ValueCollectionFactory to create and merge IValueCollection objects.

johan



On Wed, Jun 6, 2012 at 11:45 PM, Andreas Pakulat <andreas@xxxxxxxxxxxxx> wrote:
Hi,

we've recently switched our IDE to use DLTK 3.0 for the next release and
stumbled over a behavioural change in DLTK/JS for the parsing process.
The previous version we used was DLTK 1.0 and there the parser and model
parsed all of a projects .js files and was able to reference functions
across files without a problem.

With DLTK 3.0 all functions defined outside of the current file are
highlighted as a warning because the parser/model doesn't seem to find
the definition.

I've been trying to leverage the interfaces in the
org.eclipse.dltk._javascript_.core.typeinfo extension point to supply the
necessary information. But I'm a bit lost between the EMF-generated
model API and what the DLTK basic model is and especially converting
from one to another.

I've been able to avoid the warnings by implementing a IElementResolver
and returning a Method object from the typeinfo.model package, but this
doesn't have references to the actual resource and hence things like
Open Declaration don't work.

Any suggestions which interface I really do need to implement and how to
provide the necessary information to the callers based on the IResource
for the file in which the function is defined?

Andreas

--
Andreas Pakulat squish@xxxxxxxxxxxxx
froglogic GmbH - Automated UI and Web Testing
_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev


Back to the top