Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] parsing (following on from content assist)

Yep, the current content assist is doing nothing like a parse. I just hacked something together to get started because none of the existing parsers seemed to do recovery very well (or at all). As others have mentioned we are currently using JSLint and uglify as parsers. Syntax highlighting is regex-based. We are not doing any parsing on a server at the moment. We don't need to necessarily settle on a single parser. I know in JDT there are various levels of parsers used depending on the context (incremental, fuzzy/recovering, and full parse for builds). Writing _javascript_ parsers seems to be a popular sport lately and if you follow the js-tools resource list you will see a new one pop up every couple of weeks:

http://clausreinke.github.com/js-tools/resources.html

John




Andy Clement <andrew.clement@xxxxxxxxx>
Sent by: orion-dev-bounces@xxxxxxxxxxx

01/12/2012 06:34 PM

Please respond to
Orion developer discussions <orion-dev@xxxxxxxxxxx>

To
Orion developer discussions <orion-dev@xxxxxxxxxxx>
cc
Subject
Re: [orion-dev] parsing (following on from content assist)





Hi,

This relates to something I mentioned I had an interest in and is
likely the underpinnings of the content assist bug that was raised
earlier today (
https://bugs.eclipse.org/bugs/show_bug.cgi?id=368489).
I'm after a bit of information about Orion and _javascript_ parsing at
the moment.

I saw Johns comment on 368489 and I had just been looking at
jsContentAssist.js file - just to see what it might be doing in terms
of a parse (but, of course, I discovered it wasn't).  That raised a
broader question in my mind: Can I ask what parsers are used here and
there in orion right now?  I presume there is the one built into
JSLint that it uses itself.  Syntax highlighting appears to just use a
scanner? and there is no semantic highlighting, is there?  Does any
kind of parse already happen on the server?  I saw the esprima
reference in last weeks minutes, but, depending on what it is used for
I do worry a bit about recoverability - as we obviously found in the
years working on other tooling, in an IDE the parser is *usually*
dealing with broken (unfinished) code when you are in the editor.

And although something for the future, how do we feel about supporting
language mixing? for example _javascript_ with bits of HTML here and
there, and vice versa, a HTML document with _javascript_ inside.  Might
have to keep in mind the need to support these things down the line
when making parsing decisions/changes now.

thanks for any info,
Andy

On 12 January 2012 12:43, Andrew Eisenberg <andrew@xxxxxxxxxxxx> wrote:
> Hi all,
>
> I just raised:
>
https://bugs.eclipse.org/bugs/show_bug.cgi?id=368489
> which is a brain dump of some of the things I have been thinking about
> regarding content assist and type inferencing.  I'd be happy to have
> some comments.
>
> thanks,
> Andrew
> _______________________________________________
> orion-dev mailing list
> orion-dev@xxxxxxxxxxx
>
https://dev.eclipse.org/mailman/listinfo/orion-dev
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev



Back to the top