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

Hi Andreas,

Overall, validations in the current DLTK-JS are better if compared to 1.0.

The rationale for this change was that it really depends on the
environment if the files are loaded into the same context (e.g.
browser) or independently (e.g. nodejs).

One of the easy ways to proceed is implementing something similar to
org.eclipse.dltk.javascript.core.tests.typeinference.ExampleMemberEvaluator
- load all the files related to the scope.
You could make the collections immutable and cache them.

Another solution could be building EMF models for each file and returning them.

It all depends on how your runtime environment works.

Regards,
Alex

On Thu, Jun 7, 2012 at 4:45 AM, 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