Code assist extension point

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Code assist extension point

Maxime HAMM

Hi

 

I would like to raise some issue using the code assist extension point :

 

1) I have one issue, really annoying for my users : in the case bellow, you see that there is Groovy proposals but no “Jspresso” proposals…
I understand that when syntax errors exists the tree that represent the source code is corrupted…

à Have you any suggestion for that ? Why groovy proposal works and extension points proposals wouldn’t ?

 



2) About Unit tests :

I was written unit tests for my SJS DSL proposals… to do that I sought inspiration on your unit tests for Groovy proposals…

But, unless I am mistaken, there is no facilities to achieve unit tests on code assists extension point…

à Can you plan to add unit tests facilities for code assist extension point ?
You will find attached two files : the abstract one is some GREclipse code I adapted, the second one is one SJS proposal unit tests class.

Regards

Maxime


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

MethodCompletionTests.java (6K) Download Attachment
AbstractTests.java (13K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Code assist extension point

Andrew Eisenberg
> 1) I have one issue, really annoying for my users : in the case bellow, you see that there is Groovy proposals but no “Jspresso” proposals…
> I understand that when syntax errors exists the tree that represent the source code is corrupted…
>
> à Have you any suggestion for that ? Why groovy proposal works and extension points proposals wouldn’t ?

This is a limitation of the groovy parser.  The parser does not
recover particularly well from errors.  That is why some seemingly
simple syntax errors produce a broken parse tree.  We tend to fix
issues as they come up.

We have an open issue for this:

http://jira.codehaus.org/browse/GRECLIPSE-468

Please comment on the issue or raise a new issue and describe the
particular parser problem that you see and you would like to have
recovered.  Also, include a code snippet.

> 2) About Unit tests :
>
> I was written unit tests for my SJS DSL proposals… to do that I sought inspiration on your unit tests for Groovy proposals…
>
> But, unless I am mistaken, there is no facilities to achieve unit tests on code assists extension point…
>
> à Can you plan to add unit tests facilities for code assist extension point ?
> You will find attached two files : the abstract one is some GREclipse code I adapted, the second one is one SJS proposal unit tests class.

I am not exactly sure what you are suggesting.  It should be possible
to test your DSL proposals using the existing testing facilities.  Why
are you extending GroovyCompletionProposalComputer?  You should be
using the extension point and implementing the interface.  Your method
will not work unless you also implement the JDT proposal computer
extension point as well (but I don't know that off the top of my
head).

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

RE: Code assist extension point

Maxime HAMM

Hello Andrew
1) I will check the existing JIRA soon...
2) I haven't find existing facilities for code assists tests... I override
GroovyCompletionProposalComputer because i could'nt find another way to call
the "getStatementAndExpressionProposals" method... Can you please explain a
bit more how to tests a code assist extension point ?
Regards,
Maxime

-----Message d'origine-----
De : [hidden email] [mailto:[hidden email]] De la
part de Andrew Eisenberg
Envoyé : dimanche 13 juin 2010 23:12
À : [hidden email]
Objet : Re: [groovy-eclipse-plugin-dev] Code assist extension point


> 1) I have one issue, really annoying for my users : in the case bellow,
you see that there is Groovy proposals but no “Jspresso” proposals…
> I understand that when syntax errors exists the tree that represent the
source code is corrupted…
>
> à Have you any suggestion for that ? Why groovy proposal works and
extension points proposals wouldn’t ?

This is a limitation of the groovy parser.  The parser does not
recover particularly well from errors.  That is why some seemingly
simple syntax errors produce a broken parse tree.  We tend to fix
issues as they come up.

We have an open issue for this:

http://jira.codehaus.org/browse/GRECLIPSE-468

Please comment on the issue or raise a new issue and describe the
particular parser problem that you see and you would like to have
recovered.  Also, include a code snippet.

> 2) About Unit tests :
>
> I was written unit tests for my SJS DSL proposals… to do that I sought
inspiration on your unit tests for Groovy proposals…
>
> But, unless I am mistaken, there is no facilities to achieve unit tests on
code assists extension point…
>
> à Can you plan to add unit tests facilities for code assist extension
point ?
> You will find attached two files : the abstract one is some GREclipse code
I adapted, the second one is one SJS proposal unit tests class.

I am not exactly sure what you are suggesting.  It should be possible
to test your DSL proposals using the existing testing facilities.  Why
are you extending GroovyCompletionProposalComputer?  You should be
using the extension point and implementing the interface.  Your method
will not work unless you also implement the JDT proposal computer
extension point as well (but I don't know that off the top of my
head).

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email






---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email