Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [wtp-dev] Adding Content Assist for external Javascript library

Hi Julian,

Glad I was able to help.

Please open bugzillas for any content assist problems you come across. Be as specific as possible with the steps you took and include sample code. Those content assist problems can be tricky to reproduce and debug.

Thanks,
Chris


Inactive hide details for Julián Suárez <juliansuarezlopera@xxxxxxxxx>Julián Suárez <juliansuarezlopera@xxxxxxxxx>


          Julián Suárez <juliansuarezlopera@xxxxxxxxx>
          Sent by: wtp-dev-bounces@xxxxxxxxxxx

          07/23/2009 05:05 AM

          Please respond to
          "General discussion of project-wide or architectural issues." <wtp-dev@xxxxxxxxxxx>

To

"General discussion of project-wide or architectural issues." <wtp-dev@xxxxxxxxxxx>

cc


Subject

Re: [wtp-dev] Adding Content Assist for external _javascript_ library

Hi Chris!!!!

finally I've managed to get it working!!!!!! thanks to you!

I checked my initializer it seemed ok, but there was an error, a typo I must admit, that strangely remained after three times I built my plugin from scratch. The thing was that the name of my class in the plugin.xml was different from the name of the initializer class, so it was never called.

Thanks again!!!!!

Now I'm struggling with some inconsistencies of the content assist, that not only affect my library but also the Mozilla, and IE _javascript_ libraries...sometimes the classes appear twice when you do Ctrl+Space, sometimes you don't get suggestions at all, and I'm seeing a lot of exceptions like this one:

java.lang.NullPointerException
        at org.eclipse.wst.jsdt.internal.ui.text.java.ParameterGuesser$VariableCollector.collect(ParameterGuesser.java:270)

No matter what _javascript_ library I'm using...

But I think that's another subject and my main problem is now resolved!


thanks

julian

On Wed, Jul 22, 2009 at 3:47 PM, Christopher Jaun <cmjaun@xxxxxxxxxx> wrote:
    The path listed in the JSDT scope file is really just a key value. Its your container initializer that takes that value and maps it to an actual JS file. It sounds like the actual path to your library is not being resolved correctly.



    Chris


    Inactive hide details for Julián Suárez <juliansuarezlopera@xxxxxxxxx>Julián Suárez <juliansuarezlopera@xxxxxxxxx>


    Please respond to
    "General discussion of project-wide or architectural issues." <wtp-dev@xxxxxxxxxxx>
    To

    "General discussion of project-wide or architectural issues." <wtp-dev@xxxxxxxxxxx>
    cc
    Subject

    Re: [wtp-dev] Adding Content Assist for external _javascript_ library

    And I forgot I do not see mehtods or types from my library under _javascript_ References in my project...I get only my library and between parenthesis I got (unknown)


    On Tue, Jul 21, 2009 at 5:16 PM, Julián Suárez <
    juliansuarezlopera@xxxxxxxxx> wrote:
        Hi Chris, many many thanks for your suggestions

        I've made some tests adding the library file manually and it did work!, but I want to do that inside the plugin, and I want to hide the _javascript_ file containing my library from the project.

        I think I have some problems with jsdtscope file, right now after I've added the _javascript_ library from the properties menu, using my plugin,  it looks like this:


        <?xml version="1.0" encoding="UTF-8"?>
        <classpath>
            <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
            <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
                <attributes>
                    <attribute name="hide" value="true"/>
                </attributes>
            </classpathentry>
            <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
            <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.MyLibLibrary"/>
            <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.FireFoxBrowserLibrary"/>
        </classpath>

        I think the problem is that org.eclipse.wst.jsdt.support.MyLibLibrary does not exist, or is corrupt since it complains about the build path entry.

        I pretty much did the same thing as the firefox plugin, but I don't know how this org.eclipse.wst.jsdt.launching object works, what is it?

        I think that if I manage to add my library to that object my problems will be solved. Do you have any idea how can I verify that my library is loading correctly?

        thanks

        julian




        On Wed, Jul 15, 2009 at 3:28 PM, Christopher Jaun <
        cmjaun@xxxxxxxxxx> wrote:
        Hi Julian,

        It looks like you've done all the necessary steps. Sounds like you're almost there. My guess is the .jsdtscope file is not being updated correctly. I would make sure that that file is set up as expected. Then put a breakpoint in your initializer and make sure it is resolving your library entry to the correct path. Where are you storing your actual library file? Is it being put into the metadata folder or are you putting it directly in your project?

        If you expand your library node in the _javascript_ resources do you see your fields, functions, and types defined?

        If you want to do some simple tests of just your library itself you could just put it inside a folder in your project and set that folder to be a library folder using the _javascript_ project properties page.



        Chris


        Julián Suárez <
        juliansuarezlopera@xxxxxxxxx>


Please respond to
"General discussion of project-wide or architectural issues." <
wtp-dev@xxxxxxxxxxx>
To

"General discussion of project-wide or architectural issues." <
wtp-dev@xxxxxxxxxxx>
cc
Subject

Re: [wtp-dev] Adding Content Assist for external _javascript_ library

        Hi! I've managed to  create a valid js file with jsdoc comments.

        I've created a plugin with a plugin.xml similar to this one:

        <?xml version="1.0" encoding="UTF-8"?>
        <?eclipse version="3.5"?>
        <plugin>
        <!-- JSDT wizard extension -->
            <extension point="org.eclipse.wst.jsdt.ui.JsGlobalScopeContainerPage">
                <JsGlobalScopeContainerPage
                    name="MyLib Library"
                    class="org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.MyLibSupportWizardPage"
                    id="org.eclipse.wst.jsdt.support.MyLib">
              </JsGlobalScopeContainerPage>
           </extension>
            <!-- JSDT Global Scope Handler -->
            <extension
            point="org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer">
                <JsGlobalScopeContainerInitializer
                class="org.eclipse.wst.jsdt.core.compiler.libraries.MyLibLibInitializer"
                id="org.eclipse.wst.jsdt.launching.MyLibLibrary">
                </JsGlobalScopeContainerInitializer>
            </extension>
           
           <extension point="org.eclipse.wst.jsdt.ui.JsGlobalScopeUIInitializer">
             <JsGlobalScopeUIInitializer
                id="org.eclipse.wst.jsdt.launching.MyLibLibrary"
                class="org.eclipse.wst.jsdt.core.compiler.libraries.MyLibUiInitializer">
             </JsGlobalScopeUIInitializer>
           </extension>
        </plugin>


        I looked at the source code of the org.eclipse.wst.jsdt.support.firefox plugin directly from the cvs tree and I have implemented all the clases I need.....(actually I don't know if a need all that stuff).

        Then I installed the plugin I can right-click on a Web Project the Properties->_javascript_->Libraries , then I click on Add _javascript_ Library.....then I can see my library there I click next and then finish to add it.....so far so good.


        After that I can see My library inside the _javascript_ references in my project, BUT it says org.eclipse.wst.jsdt.launching.MyLib(unknown), and then, if I go agin to the properties of my project under the _javascript_->Libraries menu I see a worning on top of the window that says "Build path entry is missing: org.eclipse.wst.jsdt.launching.MyLib"


        Chris do you know what I'm missing? I haven't been able to figure it out just yet!!

        If anybody has an idea I'll be happy to try it....

        thanks

        julian

        On Wed, Jul 8, 2009 at 7:17 PM, Christopher Jaun <
        cmjaun@xxxxxxxxxx> wrote:
                Hi Julian,

                If you created a library and added it to the build path of your project then content assist will just start working. You do not have to do anything special to trigger the content assist.

                At minimum you should be implementing the following extension point -
                org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer

                Then you either need to create the UI to allow a user to manually add the new library to their project(
                org.eclipse.wst.jsdt.ui.JsGlobalScopeContainerPage and org.eclipse.wst.jsdt.ui.JsGlobalScopeUIInitializer) or you could write code to programmatically add the library based on your user scenario(IJavaScriptProject.setRawIncludePath).



                Thanks,
                Chris


                Julián Suárez <
                juliansuarezlopera@xxxxxxxxx>


Please respond to
"General discussion of project-wide or architectural issues." <
wtp-dev@xxxxxxxxxxx>
To

"General discussion of project-wide or architectural issues." <
wtp-dev@xxxxxxxxxxx>
cc
Subject

Re: [wtp-dev] Adding Content Assist for external _javascript_ library
_______________________________________________
wtp-dev mailing list
wtp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/wtp-dev

GIF image

GIF image

GIF image


Back to the top