Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ If you use Terraform to manage your infrastructure, MongoDB for VS Code helps yo
- `mdb.show`: Show or hide the MongoDB view.
- `mdb.defaultLimit`: The number of documents to fetch when viewing documents from a collection.
- `mdb.confirmRunAll`: Show a confirmation message before running commands in a playground.
- `mdb.excludeFromPlaygroundsSearch`: Exclude files and folders while searching for playground in the the current workspace.
- `mdb.connectionSaving.hideOptionToChooseWhereToSaveNewConnections`: When a connection is added, a prompt is shown that let's the user decide where the new connection should be saved. When this setting is checked, the prompt is not shown and the default connection saving location setting is used.
- `mdb.connectionSaving.defaultConnectionSavingLocation`: When the setting that hides the option to choose where to save new connections is checked, this setting sets if and where new connections are saved.
- `mdb.useDefaultTemplateForPlayground`: Choose whether to use the default template for playground files or to start with an empty playground editor.
Expand Down
4 changes: 4 additions & 0 deletions images/dark/file-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions images/light/file-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
170 changes: 116 additions & 54 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
"onCommand:mdb.removeConnection",
"onCommand:mdb.openMongoDBShell",
"onView:mongoDB",
"onView:mongoDBConnectionExplorer",
"onView:mongoDBPlaygroundsExplorer",
"onLanguage:json",
"onLanguage:mongodb"
],
Expand All @@ -87,16 +89,25 @@
"views": {
"mongoDB": [
{
"id": "mongoDB",
"name": "MongoDB",
"when": "config.mdb.show == true"
"id": "mongoDBConnectionExplorer",
"name": "Connections",
"when": "config.mdb.showMongoDBConnectionExplorer == true"
},
{
"id": "mongoDBPlaygroundsExplorer",
"name": "Playgrounds",
"when": "config.mdb.showMongoDBPlaygrounds == true"
}
]
},
"viewsWelcome": [
{
"view": "mongoDB",
"view": "mongoDBConnectionExplorer",
"contents": "No connections found.\n[Add Connection](command:mdb.connect)"
},
{
"view": "mongoDBPlaygroundsExplorer",
"contents": "No '.mongodb' playground files found in the workspace.\n[Create New Playground](command:mdb.createNewPlaygroundFromPlaygroundExplorer)"
}
],
"languages": [
Expand Down Expand Up @@ -168,10 +179,22 @@
"command": "mdb.createPlayground",
"title": "MongoDB: Create MongoDB Playground"
},
{
"command": "mdb.refreshPlaygrounds",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I think this one makes it into the command palette.

...
"editor/title": [{
  "command": "mdb. refreshPlaygrounds",
  "when": "false"
}
...]

Is it something we want in the command palette? In that case maybe we could add a command for that which has the MongoDB: prefix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added additional command for refreshing playgrounds from the command palette in addition to one is being called from the tree view. Plus test for it.

"title": "MongoDB: Refresh Playgrounds List"
},
{
"command": "mdb.refreshPlaygroundsFromTreeView",
"title": "Refresh"
},
{
"command": "mdb.createNewPlaygroundFromViewAction",
"title": "Create MongoDB Playground"
},
{
"command": "mdb.createNewPlaygroundFromPlaygroundExplorer",
"title": "Create MongoDB Playground"
},
{
"command": "mdb.changeActiveConnection",
"title": "MongoDB: Change Active Connection"
Expand Down Expand Up @@ -236,6 +259,10 @@
"dark": "images/dark/search-regular.svg"
}
},
{
"command": "mdb.openPlaygroundFromTreeItem",
"title": "Open Playground"
},
{
"command": "mdb.connectToConnectionTreeItem",
"title": "Connect"
Expand Down Expand Up @@ -317,176 +344,170 @@
"view/title": [
{
"command": "mdb.createNewPlaygroundFromViewAction",
"when": "view == mongoDB"
"when": "view == mongoDBPlaygroundsExplorer"
},
{
"command": "mdb.refreshPlaygroundsFromTreeView",
"when": "view == mongoDBPlaygroundsExplorer"
},
{
"command": "mdb.addConnection",
"when": "view == mongoDB"
"when": "view == mongoDBConnectionExplorer"
},
{
"command": "mdb.addConnectionWithURI",
"when": "view == mongoDB"
"when": "view == mongoDBConnectionExplorer"
}
],
"view/item/context": [
{
"command": "mdb.addConnection",
"when": "view == mongoDB && viewItem == mdbConnectionsTreeItem",
"group": "inline"
},
{
"command": "mdb.addConnection",
"when": "view == mongoDB && viewItem == mdbConnectionsTreeItem"
},
{
"command": "mdb.addConnectionWithURI",
"when": "view == mongoDB && viewItem == mdbConnectionsTreeItem"
},
{
"command": "mdb.addDatabase",
"when": "view == mongoDB && viewItem == connectedConnectionTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem",
"group": "inline"
},
{
"command": "mdb.addDatabase",
"when": "view == mongoDB && viewItem == connectedConnectionTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem",
"group": "1@1"
},
{
"command": "mdb.refreshConnection",
"when": "view == mongoDB && viewItem == connectedConnectionTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem",
"group": "1@2"
},
{
"command": "mdb.treeViewOpenMongoDBShell",
"when": "view == mongoDB && viewItem == connectedConnectionTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem",
"group": "2@1"
},
{
"command": "mdb.renameConnection",
"when": "view == mongoDB && viewItem == connectedConnectionTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem",
"group": "3@1"
},
{
"command": "mdb.copyConnectionString",
"when": "view == mongoDB && viewItem == connectedConnectionTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem",
"group": "4@1"
},
{
"command": "mdb.disconnectFromConnectionTreeItem",
"when": "view == mongoDB && viewItem == connectedConnectionTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem",
"group": "5@1"
},
{
"command": "mdb.treeItemRemoveConnection",
"when": "view == mongoDB && viewItem == connectedConnectionTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem",
"group": "5@2"
},
{
"command": "mdb.openPlaygroundFromTreeItem",
"when": "view == mongoDBPlaygroundsExplorer && viewItem == playgroundsTreeItem",
"group": "1@1"
},
{
"command": "mdb.connectToConnectionTreeItem",
"when": "view == mongoDB && viewItem == disconnectedConnectionTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == disconnectedConnectionTreeItem",
"group": "1@1"
},
{
"command": "mdb.renameConnection",
"when": "view == mongoDB && viewItem == disconnectedConnectionTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == disconnectedConnectionTreeItem",
"group": "2@1"
},
{
"command": "mdb.copyConnectionString",
"when": "view == mongoDB && viewItem == disconnectedConnectionTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == disconnectedConnectionTreeItem",
"group": "3@1"
},
{
"command": "mdb.treeItemRemoveConnection",
"when": "view == mongoDB && viewItem == disconnectedConnectionTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == disconnectedConnectionTreeItem",
"group": "4@1"
},
{
"command": "mdb.addCollection",
"when": "view == mongoDB && viewItem == databaseTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == databaseTreeItem",
"group": "inline"
},
{
"command": "mdb.addCollection",
"when": "view == mongoDB && viewItem == databaseTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == databaseTreeItem",
"group": "1@1"
},
{
"command": "mdb.refreshDatabase",
"when": "view == mongoDB && viewItem == databaseTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == databaseTreeItem",
"group": "1@2"
},
{
"command": "mdb.copyDatabaseName",
"when": "view == mongoDB && viewItem == databaseTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == databaseTreeItem",
"group": "2@1"
},
{
"command": "mdb.dropDatabase",
"when": "view == mongoDB && viewItem == databaseTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == databaseTreeItem",
"group": "3@1"
},
{
"command": "mdb.viewCollectionDocuments",
"when": "view == mongoDB && viewItem == collectionTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == collectionTreeItem",
"group": "1@1"
},
{
"command": "mdb.refreshCollection",
"when": "view == mongoDB && viewItem == collectionTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == collectionTreeItem",
"group": "1@2"
},
{
"command": "mdb.copyCollectionName",
"when": "view == mongoDB && viewItem == collectionTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == collectionTreeItem",
"group": "2@1"
},
{
"command": "mdb.dropCollection",
"when": "view == mongoDB && viewItem == collectionTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == collectionTreeItem",
"group": "3@1"
},
{
"command": "mdb.searchForDocuments",
"when": "view == mongoDB && viewItem == documentListTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == documentListTreeItem",
"group": "inline"
},
{
"command": "mdb.viewCollectionDocuments",
"when": "view == mongoDB && viewItem == documentListTreeItem",
"group": "1@1"
"when": "view == mongoDBConnectionExplorer && viewItem == documentListTreeItem"
},
{
"command": "mdb.refreshDocumentList",
"when": "view == mongoDB && viewItem == documentListTreeItem",
"group": "1@2"
"when": "view == mongoDBConnectionExplorer && viewItem == documentListTreeItem"
},
{
"command": "mdb.searchForDocuments",
"when": "view == mongoDB && viewItem == documentListTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == documentListTreeItem",
"group": "2@1"
},
{
"command": "mdb.refreshSchema",
"when": "view == mongoDB && viewItem == schemaTreeItem"
"when": "view == mongoDBConnectionExplorer && viewItem == schemaTreeItem"
},
{
"command": "mdb.copySchemaFieldName",
"when": "view == mongoDB && viewItem == fieldTreeItem"
"when": "view == mongoDBConnectionExplorer && viewItem == fieldTreeItem"
},
{
"command": "mdb.createIndexFromTreeView",
"when": "view == mongoDB && viewItem == indexListTreeItem",
"when": "view == mongoDBConnectionExplorer && viewItem == indexListTreeItem",
"group": "inline"
},
{
"command": "mdb.refreshIndexes",
"when": "view == mongoDB && viewItem == indexListTreeItem"
"when": "view == mongoDBConnectionExplorer && viewItem == indexListTreeItem"
},
{
"command": "mdb.createIndexFromTreeView",
"when": "view == mongoDB && viewItem == indexListTreeItem"
"when": "view == mongoDBConnectionExplorer && viewItem == indexListTreeItem"
}
],
"editor/title": [
Expand All @@ -497,6 +518,10 @@
}
],
"commandPalette": [
{
"command": "mdb.refreshPlaygroundsFromTreeView",
"when": "false"
},
{
"command": "mdb.searchForDocuments",
"when": "false"
Expand All @@ -513,6 +538,10 @@
"command": "mdb.createNewPlaygroundFromViewAction",
"when": "false"
},
{
"command": "mdb.createNewPlaygroundFromPlaygroundExplorer",
"when": "false"
},
{
"command": "mdb.changeActiveConnection",
"when": "false"
Expand All @@ -533,6 +562,10 @@
"command": "mdb.addDatabase",
"when": "false"
},
{
"command": "mdb.openPlaygroundFromTreeItem",
"when": "false"
},
{
"command": "mdb.connectToConnectionTreeItem",
"when": "false"
Expand Down Expand Up @@ -659,10 +692,38 @@
"default": "mongo",
"description": "The MongoDB shell to use."
},
"mdb.show": {
"mdb.showMongoDBConnectionExplorer": {
"type": "boolean",
"default": true,
"description": "Show or hide the MongoDB connections view."
},
"mdb.showMongoDBPlaygrounds": {
"type": "boolean",
"default": true,
"description": "Show or hide the MongoDB view."
"description": "Show or hide the MongoDB playgrounds view."
},
"mdb.excludeFromPlaygroundsSearch": {
"type": "array",
"items": {
"type": "string"
},
"description": "Files and folders to exclude while searching for playground in the the current workspace.",
"default": [
"**/.!(todo|todos|task|tasks)/**",
"**/_output/**",
"**/bower_components/**",
"**/build/**",
"**/dist/**",
"**/node_modules/**",
"**/out/**",
"**/output/**",
"**/release/**",
"**/releases/**",
"**/static/**",
"**/target/**",
"**/third_party/**",
"**/vendor/**"
]
},
"mdb.defaultLimit": {
"type": "number",
Expand Down Expand Up @@ -723,6 +784,7 @@
"debug": "^4.1.1",
"dotenv": "^8.2.0",
"encoding": "^0.1.12",
"micromatch": "^4.0.2",
"mongodb-cloud-info": "^1.1.2",
"mongodb-connection-model": "^16.1.4",
"mongodb-data-service": "^16.8.1",
Expand Down
Loading