Uploaded image for project: 'VS Code Extension'
  1. VS Code Extension
  2. VSCODE-440

Include import statements not working properly

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.6.0
    • Affects Version/s: None
    • Component/s: Import/Export
    • None
    • Environment:
      OS:
      node.js / npm versions:
      Additional info:
    • 2
    • Not Needed
    • Iteration Lambeosaurus

      Problem Statement/Rationale

      Import statements appear to be not working as intended for all languages. Some seem to be half-working (e.g Java still includes `import org.bson.Document;` but does not include import mongo client.{}

      Steps to Reproduce

      Try exporting a query to Node/Python/Java/C# (not tested yet)/Ruby and notice the missing imports. Some languages like Python & Java include other libs like bson.Document for Java and datetime for python but don't include the mongo client. 

      Expected Results

      All import statements necessary are included when `Include Import Statement` is toggled on. 

       

      For example, Java with Import Statements and Driver Syntax should include:

       

      import org.bson.Document;
      import com.mongodb.MongoClient;
      import com.mongodb.MongoClientURI;
      import com.mongodb.client.MongoCollection;
      import com.mongodb.client.MongoDatabase;
      import org.bson.conversions.Bson;
      import java.util.concurrent.TimeUnit;
      import org.bson.Document;

      and one of the following (depending on the export type)

      import com.mongodb.client.AggregateIterable;
      import com.mongodb.client.FindIterable;
      

      **

      Actual Results

      What do you observe is happening?

      Most of the expected export statements are missing:

      import org.bson.Document;
      

       

      Additional Notes

      Any additional information that may be useful to include.

        1. image.png
          image.png
          177 kB
        2. image (1).png
          image (1).png
          177 kB

            Assignee:
            paula.stachova@mongodb.com Paula Stachova
            Reporter:
            gaurab.aryal@mongodb.com Gaurab Aryal
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: