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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build Status](https://dev.azure.com/team-compass/vscode/_apis/build/status/mongodb-js.vscode?branchName=master)](https://dev.azure.com/team-compass/vscode/_build/latest?definitionId=6&branchName=master)

MongoDB for VS Code makes it easy to work with MongoDB, whether your own instance or in [MongoDB Atlas](https://www.mongodb.com/cloud/atlas/register)
MongoDB for VS Code makes it easy to work with MongoDB, whether your own instance or in [MongoDB Atlas](https://www.mongodb.com/cloud/atlas/register).

## Features

Expand All @@ -18,10 +18,10 @@ MongoDB for VS Code makes it easy to work with MongoDB, whether your own instanc

MongoDB Playgrounds are the most convenient way to prototype and execute CRUD operations and other MongoDB commands directly inside VS Code.

- Prototype your queries, aggregations and MongoDB commands with MongoDB syntax highlighting and intelligent autcomplete for MongoDB shell API, MongoDB operators, and for database, collection, and field names.
- Prototype your queries, aggregations, and MongoDB commands with MongoDB syntax highlighting and intelligent autocomplete for MongoDB shell API, MongoDB operators, and for database, collection, and field names.
- Run your playgrounds and see the results instantly
- Save your playgrounds in your workspace and use them to document how your application interacts with MongoDB
- Build aggregations quickly with helpful and well commented stage snippets
- Build aggregations quickly with helpful and well-commented stage snippets

![Playgrounds](resources/screenshots/playground.png)

Expand All @@ -47,14 +47,14 @@ If you use Terraform to manage your infrastructure, MongoDB for VS Code helps yo
- `mdb.confirmRunAll`: Show a confirmation message before running commands in a playground.
- `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 wether to use default template for playground files or to start with an empty playground editor.
- `mdb.useDefaultTemplateForPlayground`: Choose whether to use the default template for playground files or to start with an empty playground editor.
- `mdb.sendTelemetry`: Opt-in and opt-out for diagnostic and telemetry collection.

![Settings](resources/screenshots/settings.png)

## Additional Settings

*These global settings affect how MongoDB for VS Code provide intelligent autocomplete inside snippets and string literals (off by default). Changing the default configuration may affect the behavior and performance of other extensions and of VS Code itself. If you do not change the default settings, you can still trigger intelligent autcomplete inside a snippet or string literal with `Ctrl+Space`.*
*These global settings affect how MongoDB for VS Code provides intelligent autocomplete inside snippets and string literals (off by default). Changing the default configuration may affect the behavior and performance of other extensions and of VS Code itself. If you do not change the default settings, you can still trigger intelligent autocomplete inside a snippet or string literal with `Ctrl+Space`.*

- `editor.suggest.snippetsPreventQuickSuggestions`: By default, VS Code prevents code completion in snippet mode (editing placeholders in inserted code). Setting this to `false` allows snippet (eg. `$match`, `$addFields`) and field completion based on the document schema for the `db.collection.aggregate()` expressions.
- `editor.quickSuggestions`: By default, VS Code prevents code completion inside string literals. To enable database names completions for `use('dbName')` expression use this configuration:
Expand Down
42 changes: 21 additions & 21 deletions src/connectionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,22 +354,22 @@ export default class ConnectionController {
? null
: data.genuineMongoDB.dbType;
const telemetryData = {
isAtlas: !!data.client.s.url.match(ATLAS_REGEX),
isLocalhost: !!data.client.s.url.match(LOCALHOST_REGEX),
isDataLake: data.dataLake.isDataLake,
isEnterprise: data.build.enterprise_module,
isPublicCloud: cloudInfo.isPublicCloud,
publicCloudName: cloudInfo.publicCloudName,
isGenuine: data.genuineMongoDB.isGenuine,
nonGenuineServerName,
serverVersion: data.build.version,
serverArch: data.build.raw.buildEnvironment.target_arch,
serverOS: data.build.raw.buildEnvironment.target_os,
isUsedConnectScreen:
is_atlas: !!data.client.s.url.match(ATLAS_REGEX),
is_localhost: !!data.client.s.url.match(LOCALHOST_REGEX),
is_data_lake: data.dataLake.isDataLake,
is_enterprise: data.build.enterprise_module,
is_public_cloud: cloudInfo.isPublicCloud,
public_cloud_name: cloudInfo.publicCloudName,
is_genuine: data.genuineMongoDB.isGenuine,
non_genuine_server_name: nonGenuineServerName,
server_version: data.build.version,
server_arch: data.build.raw.buildEnvironment.target_arch,
server_os: data.build.raw.buildEnvironment.target_os,
is_used_connect_screen:
connectionType === ConnectionTypes.CONNECTION_FORM,
isUsedCommandPalette:
is_used_command_palette:
connectionType === ConnectionTypes.CONNECTION_STRING,
isUsedSavedConnection:
is_used_saved_connection:
connectionType === ConnectionTypes.CONNECTION_ID
};

Expand Down Expand Up @@ -659,13 +659,13 @@ export default class ConnectionController {
const connectionNameToRemove:
| string
| undefined = await vscode.window.showQuickPick(
connectionIds.map(
(id, index) => `${index + 1}: ${this._connections[id].name}`
),
{
placeHolder: 'Choose a connection to remove...'
}
);
connectionIds.map(
(id, index) => `${index + 1}: ${this._connections[id].name}`
),
{
placeHolder: 'Choose a connection to remove...'
}
);

if (!connectionNameToRemove) {
return Promise.resolve(false);
Expand Down
38 changes: 19 additions & 19 deletions src/telemetry/telemetryController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ type PlaygroundTelemetryEventProperties = {

type LinkClickedTelemetryEventProperties = {
screen: string;
linkId: string;
link_id: string;
};

type ExtensionCommandRunTelemetryEventProperties = {
command: string;
};

type NewConnectionTelemetryEventProperties = {
isAtlas: boolean;
isLocalhost: boolean;
isDataLake: boolean;
isEnterprise: boolean;
isPublicCloud: boolean;
publicCloudName: string | null;
isGenuine: boolean;
nonGenuineServerName: string | null;
serverVersion: string;
serverArch: string;
serverOS: string;
isUsedConnectScreen: boolean;
isUsedCommandPalette: boolean;
isUsedSavedConnection: boolean;
is_atlas: boolean;
is_localhost: boolean;
is_data_lake: boolean;
is_enterprise: boolean;
is_public_cloud: boolean;
public_cloud_name: string | null;
is_genuine: boolean;
non_genuine_server_name: string | null;
server_version: string;
server_arch: string;
server_os: string;
is_used_connect_screen: boolean;
is_used_command_palette: boolean;
is_used_saved_connection: boolean;
};

export type TelemetryEventProperties =
Expand All @@ -45,10 +45,10 @@ export type TelemetryEventProperties =
| NewConnectionTelemetryEventProperties;

export enum TelemetryEventTypes {
PLAYGROUND_CODE_EXECUTED = 'playground code executed',
EXTENSION_LINK_CLICKED = 'link clicked',
EXTENSION_COMMAND_RUN = 'command run',
NEW_CONNECTION = 'new connection'
PLAYGROUND_CODE_EXECUTED = 'Playground Code Executed',
EXTENSION_LINK_CLICKED = 'Link Clicked',
EXTENSION_COMMAND_RUN = 'Command Run',
NEW_CONNECTION = 'New Connection'
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/views/webviewController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default class WebviewController {
TelemetryEventTypes.EXTENSION_LINK_CLICKED,
{
screen: message.screen,
linkId: message.linkId
link_id: message.linkId
}
);

Expand Down