mongodb-js / vscode

Connect to MongoDB and Atlas and directly from your VS Code environment, navigate your databases and collections, inspect your schema and use playgrounds to prototype queries and aggregations.
https://marketplace.visualstudio.com/items?itemName=mongodb.mongodb-vscode
Apache License 2.0
327 stars 59 forks source link

fix: disable export to language when selection is invalid VSCODE-455 #808

Closed nirinchev closed 2 months ago

nirinchev commented 2 months ago

Description

This adds the mdb.canExportToLanguage to the extension context and uses it in the when clause for the export to language commands.

Checklist

Motivation and Context

Open Questions

Not sure if that's the best way to go about it - I also considered adding a the mode directly and writing a more complex when clause, but decided against it to avoid the code lens and the palette commands diverging.

Also, not sure how to test that change other than manually, so will need some pointers here.

Dependents

Types of changes

nirinchev commented 2 months ago

We're moving away from the current export to language functionality in favor of a copilot-based replacement. Once VSCODE-573 lands, we'll have alignment between the code lens and palette commands, making this problem go away.