diff --git a/source/copilot-export-test.txt b/source/copilot-export-test.txt new file mode 100644 index 00000000..7f5d3a79 --- /dev/null +++ b/source/copilot-export-test.txt @@ -0,0 +1,57 @@ +.. _vsce-test-queries-copilot: + +======================= +Export and Test Queries +======================= + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +You can use the :ref:`MongoDB Extension for Github Copilot +` to export and test your application queries in +playgrounds. + +.. note:: + + The :guilabel:`Export Code to Playground` feature is only available + if you enable |copilot|. + +Export to Playground +-------------------- + +Use the following steps to test your application code in a playground: + +.. procedure:: + :style: normal + + .. step:: Open the project file that contains the MongoDB query that you want to export. + + .. step:: Highlight the query that you want to test. + + .. step:: Right-click to select :guilabel:`Export Code to Playground`. + + Right-click your selected code to open the options menu. + Click :guilabel:`MongoDB Copilot Extension` > + :guilabel:`Export Code to Playground`. + + .. figure:: /images/export-to-playground.png + :alt: Screenshot of the export code to playground menu option. + :figwidth: 600px + + When you click :guilabel:`Export Code to Playground`, |vscode-short| + opens a new playground with your selected code in MongoDB shell + syntax. + +Once you export your code to a playground, you can click +:icon-fa5:`play` on the top right of your window to run your query. + +.. seealso:: + + - :ref:`vsce-playgrounds` + - :ref:`vsce-copilot` + diff --git a/source/export-to-language.txt b/source/export-to-language.txt index d089befb..d4a91f96 100644 --- a/source/export-to-language.txt +++ b/source/export-to-language.txt @@ -33,10 +33,15 @@ you want to export. The tutorials on this page use the default playground template. +.. note:: + + .. include:: /includes/playground-require-copilot.rst + To open a new playground containing the default template: .. include:: /includes/steps/open-new-playground.rst + Export a Query Document ----------------------- diff --git a/source/images/export-to-playground.png b/source/images/export-to-playground.png new file mode 100644 index 00000000..b9d9eeb0 Binary files /dev/null and b/source/images/export-to-playground.png differ diff --git a/source/includes/playground-require-copilot.rst b/source/includes/playground-require-copilot.rst new file mode 100644 index 00000000..63948372 --- /dev/null +++ b/source/includes/playground-require-copilot.rst @@ -0,0 +1,4 @@ +You can also open a new playground to test and export queries with the +:ref:`MongoDB Extension for Github Copilot `. For more +information, see :ref:`Export and Test Queries with Copilot +`. \ No newline at end of file diff --git a/source/playgrounds.txt b/source/playgrounds.txt index aba1cbc9..b73c1866 100644 --- a/source/playgrounds.txt +++ b/source/playgrounds.txt @@ -121,6 +121,10 @@ panel, the |vsce| *Overview* page, or the |vscode| Command Pallette. .. include:: /includes/steps/open-new-playground.rst +.. note:: + + .. include:: /includes/playground-require-copilot.rst + Open a Saved Playground ~~~~~~~~~~~~~~~~~~~~~~~ @@ -266,4 +270,5 @@ Consideration for Authentication Run Aggregation Pipelines Enable Autocomplete Export to Language + Test Driver Queries Use require()