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

Export to language from command palette

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • No version
    • Affects Version/s: None
    • Component/s: Import/Export
    • Environment:
      OS:
      node.js / npm versions:
      Additional info:
    • 2
    • Not Needed

      If you select any text in the playground and you open the vscode command palette then you will be allowed to trigger the export to code commands (eg. python one) and it may result in errors if the selected portion is not appropriate for export.

      Eg.:

      db.products.aggregate([
        { $match: {
          inStock: true
        }},
        { $group: {
          _id: "$category",
          numProducts: {
            $sum: 1
          }
        }}
      

      If I select from the first curly bracket to the last, open the command palette then select mongodb: export to python3 you will get an error: "Unable to export to python language: Need to pass 'aggregation' or 'filter' when compiling with driver syntax".
      If you instead correctly select from the first square bracket to the last one, then the export will work fine.

      The lightbulb icon is less error prone, the export commands are shown only if the selection is appropriate to be exported.

      Please check this behaviour and see if we can disallow the export command from the command palette when not appropriate.

            Assignee:
            nikola.irinchev@mongodb.com Nikola Irinchev
            Reporter:
            emilio.scalise@mongodb.com Emilio Scalise
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: