Skip to content

Commit 38b040c

Browse files
authored
DOCSP-44687 export to playground with Copilot (#103)
1 parent 72fb0e6 commit 38b040c

File tree

5 files changed

+71
-0
lines changed

5 files changed

+71
-0
lines changed

source/copilot-export-test.txt

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
.. _vsce-test-queries-copilot:
2+
3+
=======================
4+
Export and Test Queries
5+
=======================
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
You can use the :ref:`MongoDB Extension for Github Copilot
16+
<vsce-copilot>` to export and test your application queries in
17+
playgrounds.
18+
19+
.. note::
20+
21+
The :guilabel:`Export Code to Playground` feature is only available
22+
if you enable |copilot|.
23+
24+
Export to Playground
25+
--------------------
26+
27+
Use the following steps to test your application code in a playground:
28+
29+
.. procedure::
30+
:style: normal
31+
32+
.. step:: Open the project file that contains the MongoDB query that you want to export.
33+
34+
.. step:: Highlight the query that you want to test.
35+
36+
.. step:: Right-click to select :guilabel:`Export Code to Playground`.
37+
38+
Right-click your selected code to open the options menu.
39+
Click :guilabel:`MongoDB Copilot Extension` >
40+
:guilabel:`Export Code to Playground`.
41+
42+
.. figure:: /images/export-to-playground.png
43+
:alt: Screenshot of the export code to playground menu option.
44+
:figwidth: 600px
45+
46+
When you click :guilabel:`Export Code to Playground`, |vscode-short|
47+
opens a new playground with your selected code in MongoDB shell
48+
syntax.
49+
50+
Once you export your code to a playground, you can click
51+
:icon-fa5:`play` on the top right of your window to run your query.
52+
53+
.. seealso::
54+
55+
- :ref:`vsce-playgrounds`
56+
- :ref:`vsce-copilot`
57+

source/export-to-language.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,15 @@ you want to export.
3333

3434
The tutorials on this page use the default playground template.
3535

36+
.. note::
37+
38+
.. include:: /includes/playground-require-copilot.rst
39+
3640
To open a new playground containing the default template:
3741

3842
.. include:: /includes/steps/open-new-playground.rst
3943

44+
4045
Export a Query Document
4146
-----------------------
4247

191 KB
Loading
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
You can also open a new playground to test and export queries with the
2+
:ref:`MongoDB Extension for Github Copilot <vsce-copilot>`. For more
3+
information, see :ref:`Export and Test Queries with Copilot
4+
<vsce-test-queries-copilot>`.

source/playgrounds.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ panel, the |vsce| *Overview* page, or the |vscode| Command Pallette.
121121

122122
.. include:: /includes/steps/open-new-playground.rst
123123

124+
.. note::
125+
126+
.. include:: /includes/playground-require-copilot.rst
127+
124128
Open a Saved Playground
125129
~~~~~~~~~~~~~~~~~~~~~~~
126130

@@ -266,4 +270,5 @@ Consideration for Authentication
266270
Run Aggregation Pipelines </run-agg-pipelines>
267271
Enable Autocomplete </enable-autocomplete-for-string-literals>
268272
Export to Language </export-to-language>
273+
Test Driver Queries </copilot-export-test>
269274
Use require() </require-playgrounds>

0 commit comments

Comments
 (0)