facebook

Having issues with the auto-import feature

  1. CodeMix & Angular IDE
  2.  > 
  3. Webclipse 1.x Help
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #520333 Reply

    James
    Participant

    First of all, I’m loving Angular IDE. Thanks for all the hard work you guys have been putting into the project.

    I seem to be running into a problem, though, but I’m not sure if it’s because I haven’t configured things correctly. Basically, I’m trying to get Webclipse to add imports for me automatically, but I’m having mixed results. This is a TypeScript project, using AngularJS.

    To show the problem, I’ve created a package.json file, with the following dependencies:

    "dependencies": {
        "angular": "1.6.4"
    },
    "devDependencies": {
        "@types/angular": "1.6.15"
    }

    Then in the file: foo.ts, I add the following code:
    let myPromise: IPromise<string>;

    …then the IDE tells me: “Cannot find name ‘IPromise'”

    But if add the import for angular, it does what I expect:

    Cannot find name 'IPromise'.
    
    1 quick fix available:
         Import 'IPromise' from 'angular'

    I’ve uploaded a video so you can see the problem I’m experiencing:

    I’ve also added my project to github:
    https://github.com/jalbr74/import-test

    My thinking was that dependencies would be resolved in the project using package.json, so I could auto-import these dependencies as I need them.
    Am I going about this the wrong way?

    Thanks,
    James

    #520392 Reply

    support-piotr
    Participant

    James,

    Thank you for a very detailed demo of the problem! This looks definitely like a bug on our side and I’ll be glad to fix it. I am adding it to my TODO list 🙂 It’s awesome to hear that you love Angular IDE! Thanks for all of your bug reports 🙂

    Best regards,
    Piotr Tomiak

    #520425 Reply

    James
    Participant

    Awesome, thank you.

    Yeah, I’ve used Eclipse for 15 years on my Java projects, but in the last couple of years my career has switched over to Angular development. So I tried using WebStorm for the last six months, but kept wishing I had a way to do Angular and node development in Eclipse. So when I found Webclipse/Angular IDE, I was glad you guys had a solution for my situation.

    So thanks again!
    James

    #522089 Reply

    support-tony
    Keymaster

    James,

    This is now fixed in the latest release, CI 5. Please go to Help->Webclipse->Check for Updates and follow the wizard to install them. Let us know if you see any problems.

    #522925 Reply

    James
    Participant

    Hi, I have verified it now imports properly ‘Injectable’ from angular properly, thank you.

    However, I am still seeing a problem with resolving ambiguity, when the type exists in more than one location. For example, given the following code:

    import {  } from 'ng-metadata/core';
    import {  } from 'angular';
    
    @Injectable()
    export class SsprService {
    }

    If I use the “quick fix” feature to add the import, I end up with:

    
    import { Injectable } from 'angular';
    

    … when I want to end up with:

    
    import { Injectable } from 'ng-metadata/core';
    

    I would have expected to be prompted for the right one to import, since it exists in two different places.

    Thanks,
    James

    • This reply was modified 7 years, 6 months ago by James.
    • This reply was modified 7 years, 6 months ago by James.
    #523020 Reply

    support-swapna
    Moderator

    James,

    I have filed a bug for the dev team to fix the import issue when the type exists in more than one location.
    Thank you for raising it. Sorry for inconvenience caused.

    –Swapna
    MyEclipse Support

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Having issues with the auto-import feature

You must be logged in to post in the forum log in