From da276c7232c322e157147db3538576a2ab77635c Mon Sep 17 00:00:00 2001 From: jasondaming Date: Wed, 2 Dec 2020 10:03:35 -0600 Subject: [PATCH 1/6] rearrange and remove the non critical items --- .../debugging-robot-program.rst | 69 ++++++------------- 1 file changed, 22 insertions(+), 47 deletions(-) diff --git a/source/docs/software/vscode-overview/debugging-robot-program.rst b/source/docs/software/vscode-overview/debugging-robot-program.rst index 88ecd1ad8c..814a5af4c9 100644 --- a/source/docs/software/vscode-overview/debugging-robot-program.rst +++ b/source/docs/software/vscode-overview/debugging-robot-program.rst @@ -7,70 +7,45 @@ A debugger is a tool used to control program flow and monitor variables in order .. note:: For beginning users who need to debug their programs but do not know/have time to learn how to use a debugger, it is often possible to debug a program simply by printing the relevant program state to the console. However, it is strongly recommended that students eventually learn to use a debugger. +Running the Debugger +-------------------- + +|Start Debugging| + +Press Ctrl+Shift+P and type WPILib or click on the WPILib Menu item to open the Command palette with WPILib pre-populated. Type Debug and select the Debug Robot Code menu item to start debugging. The code will download to the roboRIO and begin debugging. + Breakpoints ----------- -A "breakpoint" is a line of code at which the debugger will stop the program execution so that the user can examine the program state. This is extremely useful while debugging, as it allows the user to pause the program at specific points in problematic code to determine where exactly the program is deviating from the expected behavior. +A "breakpoint" is a line of code at which the debugger will pause the program execution so that the user can examine the program state. This is extremely useful while debugging, as it allows the user to pause the program at specific points in problematic code to determine where exactly the program is deviating from the expected behavior. + +The debugger will automatically pause at the first breakpoint it encounters. Setting a Breakpoint ~~~~~~~~~~~~~~~~~~~~ |Setting a Breakpoint| -Double-click in the left margin of the source code window to set a breakpoint in your user program: A small red circle indicates the breakpoint has been set on the corresponding line. - -Viewing Program State -~~~~~~~~~~~~~~~~~~~~~ - -|Debug Tab| - -When the program is stopped at a breakpoint, various pieces of program state can be viewed from the debug tab. The Debug tab is accessed by clicking on the debug icon on the far left pane. Within the debug tab, the program state can be viewed from an assortment of "panes." - -The Variables Pane -^^^^^^^^^^^^^^^^^^ - -|Variables Pane| - -The Variables view shows the current values of variables. To see a variable that is not displayed, select the “Watch” pane and enter the variable name. This will show the variable’s value if it’s in-scope. Clicking on the arrows next to a variable name will expand the tree and show its `fields `__. +Click in the left margin of the source code window (to the left of the line number) to set a breakpoint in your user program: A small red circle indicates the breakpoint has been set on the corresponding line. -Watch Pane -^^^^^^^^^^ - -|Watch Pane| - -The Watch Pane can be used to monitor specific variables or expressions while debugging. To add an expression, right-click and select Add Expression. - -Call Stack -^^^^^^^^^^ - -|Call Stack| - -The Call Stack pane is used to display the current `call stack `__ of the running program. This can be used to monitor the current call hierarchy of the program while debugging. - -Breakpoint Pane -^^^^^^^^^^^^^^^ +Debugging with Console +---------------------- +Another way to debug your program is to use print statements in your code and view them using the RioLog in Visual Studio Code or the Driver Station. -|Breakpoint Pane| +.. tabs:: -The Breakpoint Pane displays all of the current breakpoints. To temporarily disable a breakpoint without permanently removing it, click the corresponding checkbox. + .. code-tab:: java -Running the Debugger --------------------- + System.out.print("example"); -|Start Debugging| + .. code-tab:: c++ -Press Ctrl+Shift+P and type WPILib or click on the WPILib Menu item to open the Command palette with WPILib pre-populated. Type Debug and select the Debug Robot Code menu item to start debugging. The code will download to the roboRIO and begin debugging. + void RobotInit() {} -The debugger will automatically pause at the first breakpoint it encounters. The user can then tell the debugger when to proceed to the next breakpoint. +Learn More +---------- -Debugging with Console ----------------------- -Another way to debug your program is to use System.out.println statements in your code and receive them using the RioLog in Visual Studio Code. +To learn more about debugging with VS Code see this `link `__. .. |Setting a Breakpoint| image:: images/debugging-robot-program/setting-a-breakpoint.png -.. |Debug Tab| image:: images/debugging-robot-program/debug-tab.png -.. |Variables Pane| image:: images/debugging-robot-program/variables-pane.png -.. |Watch Pane| image:: images/debugging-robot-program/watch-pane.png -.. |Call Stack| image:: images/debugging-robot-program/call-stack.png -.. |Breakpoint Pane| image:: images/debugging-robot-program/breakpoint-pane.png .. |Start Debugging| image:: images/debugging-robot-program/start-debugging.png From 44c8c7472f6aa2901030ee9d12257178b8b21ebb Mon Sep 17 00:00:00 2001 From: jasondaming Date: Wed, 2 Dec 2020 22:03:06 -0600 Subject: [PATCH 2/6] added OutlineViewer and more links --- .../debugging-robot-program.rst | 21 ++++++++++++------- .../wpilib-tools/outlineviewer/index.rst | 3 +++ source/index.rst | 1 + 3 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 source/docs/software/wpilib-tools/outlineviewer/index.rst diff --git a/source/docs/software/vscode-overview/debugging-robot-program.rst b/source/docs/software/vscode-overview/debugging-robot-program.rst index 814a5af4c9..dc4535eed0 100644 --- a/source/docs/software/vscode-overview/debugging-robot-program.rst +++ b/source/docs/software/vscode-overview/debugging-robot-program.rst @@ -5,8 +5,6 @@ Inevitably, a program will not behave in the way we expect it to behave. When t A debugger is a tool used to control program flow and monitor variables in order to assist in debugging a program. This section will describe how to set up a debug session for an FRC robot program. -.. note:: For beginning users who need to debug their programs but do not know/have time to learn how to use a debugger, it is often possible to debug a program simply by printing the relevant program state to the console. However, it is strongly recommended that students eventually learn to use a debugger. - Running the Debugger -------------------- @@ -28,9 +26,10 @@ Setting a Breakpoint Click in the left margin of the source code window (to the left of the line number) to set a breakpoint in your user program: A small red circle indicates the breakpoint has been set on the corresponding line. -Debugging with Console ----------------------- -Another way to debug your program is to use print statements in your code and view them using the RioLog in Visual Studio Code or the Driver Station. +Debugging with Print Statements +------------------------------- + +Another way to debug your program is to use print statements in your code and view them using the RioLog in Visual Studio Code or the Driver Station. Print statements should be added with care as they are not very efficient especially when used in high quantities. They should be removed for competition as they can cause loop overruns. .. tabs:: @@ -40,12 +39,20 @@ Another way to debug your program is to use print statements in your code and vi .. code-tab:: c++ - void RobotInit() {} + fmt::print("example"); + +Debugging with Network Tables +----------------------------- + +:doc:`Network Tables ` can be used to share robot information with your debugging computer. Network Tables can be viewed with your favorite Dashboard or :doc:`OutlineViewer `. One advantage of Network Tables is that tools like :doc:`Shuffleboard ` can be used to graphically analyze the data. These same tools can then be used with same data to later provide an operator interface for your drivers. Learn More ---------- -To learn more about debugging with VS Code see this `link `__. +- To learn more about debugging with VS Code see this `link `__. +- Some of the features mentioned in this VS Code `article `__ will help you understand and diagnose problems with your code. The Quick Fix (yellow light bulb) feature can be very helpful with a variety of problems including what to import. +- One of the best ways to prevent having to debug so many issues is to do Unit Testing. +- Verifying that your robot works in :doc:`Simulation ` is also a great way to prevent having to do complex debugging on the actual robot. .. |Setting a Breakpoint| image:: images/debugging-robot-program/setting-a-breakpoint.png .. |Start Debugging| image:: images/debugging-robot-program/start-debugging.png diff --git a/source/docs/software/wpilib-tools/outlineviewer/index.rst b/source/docs/software/wpilib-tools/outlineviewer/index.rst new file mode 100644 index 0000000000..69ea6855ad --- /dev/null +++ b/source/docs/software/wpilib-tools/outlineviewer/index.rst @@ -0,0 +1,3 @@ +OutlineViewer +============= + diff --git a/source/index.rst b/source/index.rst index e72558475d..85c2f988f0 100644 --- a/source/index.rst +++ b/source/index.rst @@ -61,6 +61,7 @@ Welcome to the *FIRST*\ |reg| Robotics Competition Control System Documentation! docs/software/wpilib-tools/robotbuilder/index docs/software/wpilib-tools/robot-simulation/index docs/software/wpilib-tools/robot-characterization/index + docs/software/wpilib-tools/outlineviewer/index .. toctree:: :maxdepth: 1 From 1197b42c1261fd63b43e877ba4c82ca005b588a3 Mon Sep 17 00:00:00 2001 From: jasondaming Date: Wed, 2 Dec 2020 22:16:39 -0600 Subject: [PATCH 3/6] removed trailing whitespace --- .../docs/software/vscode-overview/debugging-robot-program.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/docs/software/vscode-overview/debugging-robot-program.rst b/source/docs/software/vscode-overview/debugging-robot-program.rst index dc4535eed0..8c18b4f81b 100644 --- a/source/docs/software/vscode-overview/debugging-robot-program.rst +++ b/source/docs/software/vscode-overview/debugging-robot-program.rst @@ -29,13 +29,13 @@ Click in the left margin of the source code window (to the left of the line numb Debugging with Print Statements ------------------------------- -Another way to debug your program is to use print statements in your code and view them using the RioLog in Visual Studio Code or the Driver Station. Print statements should be added with care as they are not very efficient especially when used in high quantities. They should be removed for competition as they can cause loop overruns. +Another way to debug your program is to use print statements in your code and view them using the RioLog in Visual Studio Code or the Driver Station. Print statements should be added with care as they are not very efficient especially when used in high quantities. They should be removed for competition as they can cause loop overruns. .. tabs:: .. code-tab:: java - System.out.print("example"); + System.out.print("example"); .. code-tab:: c++ From 432ee9bbd5b5a459b5376af0b7705a0916d06953 Mon Sep 17 00:00:00 2001 From: jasondaming Date: Wed, 2 Dec 2020 22:46:16 -0600 Subject: [PATCH 4/6] different C++ printline example --- .../docs/software/vscode-overview/debugging-robot-program.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/docs/software/vscode-overview/debugging-robot-program.rst b/source/docs/software/vscode-overview/debugging-robot-program.rst index 8c18b4f81b..110afe4570 100644 --- a/source/docs/software/vscode-overview/debugging-robot-program.rst +++ b/source/docs/software/vscode-overview/debugging-robot-program.rst @@ -39,7 +39,7 @@ Another way to debug your program is to use print statements in your code and vi .. code-tab:: c++ - fmt::print("example"); + wpi::outs() << "example\n"; Debugging with Network Tables ----------------------------- From 85629c361a69869dfed68adab0c050e96ebefbb7 Mon Sep 17 00:00:00 2001 From: jasondaming Date: Thu, 3 Dec 2020 13:48:33 -0600 Subject: [PATCH 5/6] Removed OutlineViewer stuff added warning --- .../docs/software/vscode-overview/debugging-robot-program.rst | 4 +++- source/docs/software/wpilib-tools/outlineviewer/index.rst | 3 --- source/index.rst | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 source/docs/software/wpilib-tools/outlineviewer/index.rst diff --git a/source/docs/software/vscode-overview/debugging-robot-program.rst b/source/docs/software/vscode-overview/debugging-robot-program.rst index 110afe4570..5d57f7ca1f 100644 --- a/source/docs/software/vscode-overview/debugging-robot-program.rst +++ b/source/docs/software/vscode-overview/debugging-robot-program.rst @@ -5,6 +5,8 @@ Inevitably, a program will not behave in the way we expect it to behave. When t A debugger is a tool used to control program flow and monitor variables in order to assist in debugging a program. This section will describe how to set up a debug session for an FRC robot program. +.. note:: For beginning users who need to debug their programs but do not know/have time to learn how to use a debugger, it is often possible to debug a program simply by printing the relevant program state to the console. However, it is strongly recommended that students eventually learn to use a debugger. + Running the Debugger -------------------- @@ -44,7 +46,7 @@ Another way to debug your program is to use print statements in your code and vi Debugging with Network Tables ----------------------------- -:doc:`Network Tables ` can be used to share robot information with your debugging computer. Network Tables can be viewed with your favorite Dashboard or :doc:`OutlineViewer `. One advantage of Network Tables is that tools like :doc:`Shuffleboard ` can be used to graphically analyze the data. These same tools can then be used with same data to later provide an operator interface for your drivers. +:doc:`Network Tables ` can be used to share robot information with your debugging computer. Network Tables can be viewed with your favorite Dashboard or OutlineViewer. One advantage of Network Tables is that tools like :doc:`Shuffleboard ` can be used to graphically analyze the data. These same tools can then be used with same data to later provide an operator interface for your drivers. Learn More ---------- diff --git a/source/docs/software/wpilib-tools/outlineviewer/index.rst b/source/docs/software/wpilib-tools/outlineviewer/index.rst deleted file mode 100644 index 69ea6855ad..0000000000 --- a/source/docs/software/wpilib-tools/outlineviewer/index.rst +++ /dev/null @@ -1,3 +0,0 @@ -OutlineViewer -============= - diff --git a/source/index.rst b/source/index.rst index 85c2f988f0..e72558475d 100644 --- a/source/index.rst +++ b/source/index.rst @@ -61,7 +61,6 @@ Welcome to the *FIRST*\ |reg| Robotics Competition Control System Documentation! docs/software/wpilib-tools/robotbuilder/index docs/software/wpilib-tools/robot-simulation/index docs/software/wpilib-tools/robot-characterization/index - docs/software/wpilib-tools/outlineviewer/index .. toctree:: :maxdepth: 1 From 7856cebb63edbb7b7d6377dfce953b041fbea155 Mon Sep 17 00:00:00 2001 From: jasondaming Date: Fri, 4 Dec 2020 16:25:01 -0600 Subject: [PATCH 6/6] add a lot of :kbd:, fixed TOC --- .../measuring-bandwidth-usage.rst | 2 +- .../basic-programming/git-getting-started.rst | 2 +- .../software/examples-tutorials/wpilib-examples.rst | 2 +- .../creating-robot-programs/tank-drive-tutorial.rst | 2 +- ...ing-the-axis-camera-at-single-network-events.rst | 6 +++--- .../vscode-overview/3rd-party-libraries.rst | 2 +- .../vscode-overview/creating-robot-program.rst | 4 ++-- .../vscode-overview/debugging-robot-program.rst | 13 ++++++------- .../vscode-overview/importing-eclipse-project.rst | 4 ++-- .../vscode-overview/importing-gradle-project.rst | 4 ++-- source/docs/software/vscode-overview/index.rst | 2 +- .../vscode-overview/viewing-console-output.rst | 2 +- .../docs/software/vscode-overview/vscode-basics.rst | 2 +- .../vscode-overview/wpilib-commands-vscode.rst | 2 +- .../introduction/starting-robotbuilder.rst | 2 +- .../verifying-smartdashboard-is-working.rst | 2 +- .../creating-benchtop-test-program-cpp-java.rst | 4 ++-- 17 files changed, 28 insertions(+), 29 deletions(-) diff --git a/source/docs/networking/networking-introduction/measuring-bandwidth-usage.rst b/source/docs/networking/networking-introduction/measuring-bandwidth-usage.rst index d733663674..beaead2217 100644 --- a/source/docs/networking/networking-introduction/measuring-bandwidth-usage.rst +++ b/source/docs/networking/networking-introduction/measuring-bandwidth-usage.rst @@ -45,7 +45,7 @@ Configure Data Properties .. image:: images/measuring-bandwidth-usage-5.png -Press ``Ctrl+Q`` to bring up the Properties window. Click on the dropdown next to ``Scale`` and select ``1.0``. Then click on the ``Graph`` tab. +Press :kbd:`Ctrl+Q` to bring up the Properties window. Click on the dropdown next to ``Scale`` and select ``1.0``. Then click on the ``Graph`` tab. Configure Graph Properties ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/source/docs/software/basic-programming/git-getting-started.rst b/source/docs/software/basic-programming/git-getting-started.rst index 7451ac4906..53a397b0bc 100644 --- a/source/docs/software/basic-programming/git-getting-started.rst +++ b/source/docs/software/basic-programming/git-getting-started.rst @@ -85,7 +85,7 @@ You should see a screen similar to this .. image:: images/image6.png -.. note:: The keyboard shortcut ``ctrl`` + ``~`` can be used to open a terminal in Visual Studio Code. +.. note:: The keyboard shortcut :kbd:`Ctrl+~` can be used to open a terminal in Visual Studio Code. Now you'll want to open a PowerShell window and navigate to your project directory. An excellent tutorial on PowerShell can be found `here `__. Please consult your search engine on how to open a terminal on alternative operating systems. diff --git a/source/docs/software/examples-tutorials/wpilib-examples.rst b/source/docs/software/examples-tutorials/wpilib-examples.rst index d837b39730..4d8d32525a 100644 --- a/source/docs/software/examples-tutorials/wpilib-examples.rst +++ b/source/docs/software/examples-tutorials/wpilib-examples.rst @@ -3,7 +3,7 @@ WPILib Example Projects .. warning:: While every attempt is made to keep WPILib examples functional, they are *not* intended to be used "as-is." At the very least, robot-specific constants will need to be changed for the code to work on a user robot. Many empirical constants have their values "faked" for demonstration purposes. Users are strongly encouraged to write their own code (from scratch or from an existing template) rather than copy example code. -WPILib example projects demonstrate a large number of library features and use patterns. Projects range from simple demonstrations of a single functionality to complete, competition-capable robot programs. All of these examples are available in VS Code by entering Control+Shift+P, then selecting `WPILib: Create a new project` and choosing example. +WPILib example projects demonstrate a large number of library features and use patterns. Projects range from simple demonstrations of a single functionality to complete, competition-capable robot programs. All of these examples are available in VS Code by entering :kbd:`Ctrl+Shift+P`, then selecting `WPILib: Create a new project` and choosing example. .. image:: /docs/software/vscode-overview/images/creating-robot-program/create-new-project.png diff --git a/source/docs/software/labview/creating-robot-programs/tank-drive-tutorial.rst b/source/docs/software/labview/creating-robot-programs/tank-drive-tutorial.rst index 54c4358249..903465762f 100644 --- a/source/docs/software/labview/creating-robot-programs/tank-drive-tutorial.rst +++ b/source/docs/software/labview/creating-robot-programs/tank-drive-tutorial.rst @@ -15,7 +15,7 @@ Tank Drive Tutorial 3. In the Project Explorer window, open up the ``Robot Main.vi``. -4. Push Ctrl + E to see the block diagram. It should look like the following image: +4. Push :kbd:`Ctrl+E` to see the block diagram. It should look like the following image: .. image:: images/tank-drive-tutorial/block-diagram.png diff --git a/source/docs/software/vision-processing/axis-camera/using-the-axis-camera-at-single-network-events.rst b/source/docs/software/vision-processing/axis-camera/using-the-axis-camera-at-single-network-events.rst index 98bb48c940..21f4300783 100644 --- a/source/docs/software/vision-processing/axis-camera/using-the-axis-camera-at-single-network-events.rst +++ b/source/docs/software/vision-processing/axis-camera/using-the-axis-camera-at-single-network-events.rst @@ -30,14 +30,14 @@ Locating Loop 2 - Camera IP .. image:: images/using-the-axis-camera-at-single-network-events/locating-loop-2-camera-ip.png -Double click on ``Dashboard Main.vi`` in the project explorer to open it and press Ctrl+e to see the block diagram. Scroll down to the loop with the comment that says Loop 2 and locate the "Camera IP" input. +Double click on ``Dashboard Main.vi`` in the project explorer to open it and press :kbd:`Ctrl+E` to see the block diagram. Scroll down to the loop with the comment that says Loop 2 and locate the "Camera IP" input. Editing the Camera IP ^^^^^^^^^^^^^^^^^^^^^ .. image:: images/using-the-axis-camera-at-single-network-events/editing-the-camera-ip.png -Delete the Camera IP node, right click on the broken wire and click Create Constant (connect the constant to the wire if necessary). In the box, enter the mDNS name of your camera with a ``.local`` suffix (e.g. ``axis-cameraTEAM.local`` where ``TEAM`` is replaced with your team number). The example above shows a sample name for team 9999. Then click File->Save or Ctrl+S to save the VI. +Delete the Camera IP node, right click on the broken wire and click Create Constant (connect the constant to the wire if necessary). In the box, enter the mDNS name of your camera with a ``.local`` suffix (e.g. ``axis-cameraTEAM.local`` where ``TEAM`` is replaced with your team number). The example above shows a sample name for team 9999. Then click File->Save or :kbd:`Ctrl+S` to save the VI. .. note:: You may also wish to make a minor modification to the Front Panel to verify that you are running the right dashboard later. @@ -65,4 +65,4 @@ Modifying LabVIEW Robot Code .. image:: images/using-the-axis-camera-at-single-network-events/modifying-labview-robot-code.png -In the Project Explorer, locate ``Vision Processing.VI`` and double click to open it. Then press Ctrl+e to open the Block Diagram. Locate the string ``axis-camera.local`` near the left of the image and replace with ``axis-cameraTEAM.local``. Also make sure the constant is set to ``False`` to use the Axis camera instead of USB. +In the Project Explorer, locate ``Vision Processing.VI`` and double click to open it. Then press :kbd:`Ctrl+E` to open the Block Diagram. Locate the string ``axis-camera.local`` near the left of the image and replace with ``axis-cameraTEAM.local``. Also make sure the constant is set to ``False`` to use the Axis camera instead of USB. diff --git a/source/docs/software/vscode-overview/3rd-party-libraries.rst b/source/docs/software/vscode-overview/3rd-party-libraries.rst index 327628be20..8747eec567 100644 --- a/source/docs/software/vscode-overview/3rd-party-libraries.rst +++ b/source/docs/software/vscode-overview/3rd-party-libraries.rst @@ -69,7 +69,7 @@ Adding an Offline-Installed Library .. image:: images/3rd-party-libraries/adding-offline-library.png -To add a vendor library that has been installed by an offline installer, press **Ctrl+Shift+P** and type WPILib or click on the WPILib icon in the top right to open the WPILib Command Palette and begin typing **Manage Vendor Libraries**, then select it from the menu. Select the option to **Install new libraries (offline)**. +To add a vendor library that has been installed by an offline installer, press :kbd:`Ctrl+Shift+P` and type WPILib or click on the WPILib icon in the top right to open the WPILib Command Palette and begin typing **Manage Vendor Libraries**, then select it from the menu. Select the option to **Install new libraries (offline)**. .. image:: images/3rd-party-libraries/library-installer-steptwo.png diff --git a/source/docs/software/vscode-overview/creating-robot-program.rst b/source/docs/software/vscode-overview/creating-robot-program.rst index 38386b7c5a..01f42ad0f5 100644 --- a/source/docs/software/vscode-overview/creating-robot-program.rst +++ b/source/docs/software/vscode-overview/creating-robot-program.rst @@ -139,7 +139,7 @@ If desired, users can omit a base class entirely and simply write their program Creating a New WPILib Project ----------------------------- -Once we've decided on a base class, we can create our new robot project. Bring up the Visual Studio Code command palette with :kbd:"Control+Shift+P": +Once we've decided on a base class, we can create our new robot project. Bring up the Visual Studio Code command palette with :kbd:`Ctrl+Shift+P`: |Command Palette| @@ -177,7 +177,7 @@ An example after all options are selected is shown below. Opening The New Project ----------------------- -After successfully creating your project, VS Code will give the option of opening the project as shown below. We can choose to do that now or later by typing :kbd:`Ctrl-K` then :kbd:`Ctrl-O` (or just :kbd:`Command+O` on macOS) and select the folder where We saved our project. +After successfully creating your project, VS Code will give the option of opening the project as shown below. We can choose to do that now or later by typing :kbd:`Ctrl+K` then :kbd:`Ctrl+O` (or just :kbd:`Command+O` on macOS) and select the folder where We saved our project. Once opened we will see the project hierarchy on the left. Double clicking on the file will open that file in the editor. diff --git a/source/docs/software/vscode-overview/debugging-robot-program.rst b/source/docs/software/vscode-overview/debugging-robot-program.rst index 5d57f7ca1f..be686636b0 100644 --- a/source/docs/software/vscode-overview/debugging-robot-program.rst +++ b/source/docs/software/vscode-overview/debugging-robot-program.rst @@ -10,9 +10,10 @@ A debugger is a tool used to control program flow and monitor variables in order Running the Debugger -------------------- -|Start Debugging| +.. image:: images/debugging-robot-program/start-debugging.png + :alt: Shows running the debugger via the Command Palette. -Press Ctrl+Shift+P and type WPILib or click on the WPILib Menu item to open the Command palette with WPILib pre-populated. Type Debug and select the Debug Robot Code menu item to start debugging. The code will download to the roboRIO and begin debugging. +Press :kbd:`Ctrl+Shift+P` and type ``WPILib`` or click on the :guilabel:`WPILib Menu Item` to open the Command palette with WPILib pre-populated. Type Debug and select the Debug Robot Code menu item to start debugging. The code will download to the roboRIO and begin debugging. Breakpoints ----------- @@ -22,9 +23,10 @@ A "breakpoint" is a line of code at which the debugger will pause the program ex The debugger will automatically pause at the first breakpoint it encounters. Setting a Breakpoint -~~~~~~~~~~~~~~~~~~~~ +^^^^^^^^^^^^^^^^^^^^ -|Setting a Breakpoint| +.. image:: images/debugging-robot-program/setting-a-breakpoint.png + :alt: Shows where to place the cursor to create a breakpoint. Click in the left margin of the source code window (to the left of the line number) to set a breakpoint in your user program: A small red circle indicates the breakpoint has been set on the corresponding line. @@ -55,6 +57,3 @@ Learn More - Some of the features mentioned in this VS Code `article `__ will help you understand and diagnose problems with your code. The Quick Fix (yellow light bulb) feature can be very helpful with a variety of problems including what to import. - One of the best ways to prevent having to debug so many issues is to do Unit Testing. - Verifying that your robot works in :doc:`Simulation ` is also a great way to prevent having to do complex debugging on the actual robot. - -.. |Setting a Breakpoint| image:: images/debugging-robot-program/setting-a-breakpoint.png -.. |Start Debugging| image:: images/debugging-robot-program/start-debugging.png diff --git a/source/docs/software/vscode-overview/importing-eclipse-project.rst b/source/docs/software/vscode-overview/importing-eclipse-project.rst index 8ef4b4cdd0..3357cbd1b7 100644 --- a/source/docs/software/vscode-overview/importing-eclipse-project.rst +++ b/source/docs/software/vscode-overview/importing-eclipse-project.rst @@ -9,7 +9,7 @@ Launching the Import Wizard |Launching Import Wizard| -Press Ctrl+Shift+P and type "WPILib" or click the WPILib icon to locate the WPILib commands. Begin typing "Import a WPILib Eclipse project" and select it from the dropdown. +Press :kbd:`Ctrl+Shift+P` and type "WPILib" or click the WPILib icon to locate the WPILib commands. Begin typing "Import a WPILib Eclipse project" and select it from the dropdown. |Eclipse Project Importer| @@ -23,7 +23,7 @@ You'll be presented with the WPILib Eclipse Project Upgrade window. This is simi Click "Upgrade Project" to begin the upgrade. -The eclipse project will be upgraded and copied into the new project directory. You can then either open the new project immediately (the pop-up shown below should appear in the bottom right) or open it later using the Ctrl-O (or Command-O for macOS) shortcut. +The eclipse project will be upgraded and copied into the new project directory. You can then either open the new project immediately (the pop-up shown below should appear in the bottom right) or open it later using the :kbd:`Ctrl+O` (or Command-O for macOS) shortcut. |Opening Project| diff --git a/source/docs/software/vscode-overview/importing-gradle-project.rst b/source/docs/software/vscode-overview/importing-gradle-project.rst index 9a48fc4205..0da16dd183 100644 --- a/source/docs/software/vscode-overview/importing-gradle-project.rst +++ b/source/docs/software/vscode-overview/importing-gradle-project.rst @@ -12,7 +12,7 @@ Launching the Import Wizard When you open a previous year's project, you will be prompted to import that project. Click :guilabel:`yes`. -Alternately, you can chose to import it from the menu. Press Ctrl+Shift+P and type "WPILib" or click the WPILib icon to locate the WPILib commands. Begin typing "Import a WPILib 2020 Gradle project" and select it from the dropdown as shown below. +Alternately, you can chose to import it from the menu. Press :kbd:`Ctrl+Shift+P` and type "WPILib" or click the WPILib icon to locate the WPILib commands. Begin typing "Import a WPILib 2020 Gradle project" and select it from the dropdown as shown below. .. image:: images/importing-previous-project/ImportGradleMenu.png @@ -29,7 +29,7 @@ You'll be presented with the WPILib Project Importer window. This is similar to Click :guilabel:`Import Project` to begin the upgrade. -The gradle project will be upgraded and copied into the new project directory. You can then either open the new project immediately (the pop-up shown below should appear in the bottom right) or open it later using the Ctrl-O (or Command-O for macOS) shortcut. +The gradle project will be upgraded and copied into the new project directory. You can then either open the new project immediately (the pop-up shown below should appear in the bottom right) or open it later using the :kbd:`Ctrl+O` (or :kbd:`Command+O` for macOS) shortcut. .. image:: images/importing-eclipse-project/opening-project.png diff --git a/source/docs/software/vscode-overview/index.rst b/source/docs/software/vscode-overview/index.rst index 7880fbf6dd..8bf4ba24a9 100644 --- a/source/docs/software/vscode-overview/index.rst +++ b/source/docs/software/vscode-overview/index.rst @@ -7,10 +7,10 @@ VS Code Overview vscode-basics wpilib-commands-vscode creating-robot-program + 3rd-party-libraries deploying-robot-code viewing-console-output debugging-robot-program - 3rd-party-libraries importing-eclipse-project importing-gradle-project using-test-mode diff --git a/source/docs/software/vscode-overview/viewing-console-output.rst b/source/docs/software/vscode-overview/viewing-console-output.rst index 68190b917e..2e6874385d 100644 --- a/source/docs/software/vscode-overview/viewing-console-output.rst +++ b/source/docs/software/vscode-overview/viewing-console-output.rst @@ -32,7 +32,7 @@ Opening the RioLog View |Opening Riolog View| -By default, the RioLog view will open automatically at the end of each roboRIO deploy. To launch the RioLog view manually, press Ctrl+Shift+P to open the command palette and start typing "RioLog", then select the WPILib: Start RioLog option. +By default, the RioLog view will open automatically at the end of each roboRIO deploy. To launch the RioLog view manually, press :kbd:`Ctrl+Shift+P` to open the command palette and start typing "RioLog", then select the WPILib: Start RioLog option. Riolog Window ~~~~~~~~~~~~~ diff --git a/source/docs/software/vscode-overview/vscode-basics.rst b/source/docs/software/vscode-overview/vscode-basics.rst index 9850411b88..7a1035e116 100644 --- a/source/docs/software/vscode-overview/vscode-basics.rst +++ b/source/docs/software/vscode-overview/vscode-basics.rst @@ -20,7 +20,7 @@ The most important link to take a look at is probably the basic User Interface d Command Palette --------------- -The Command Palette can be used to access or run almost any function or feature in Visual Studio Code (including those from the WPILib extension). The Command Palette can be accessed from the View menu or by pressing Ctrl+Shift+P (Cmd+Shift+P on macOS). Typing text into the window will dynamically narrow the search to relevant commands and show them in the dropdown. +The Command Palette can be used to access or run almost any function or feature in Visual Studio Code (including those from the WPILib extension). The Command Palette can be accessed from the View menu or by pressing :kbd:`Ctrl+Shift+P` (:kbd:`Cmd+Shift+P` on macOS). Typing text into the window will dynamically narrow the search to relevant commands and show them in the dropdown. In the following example "wpilib" is typed into the search box after activating the Command Palette, and it narrows the list to functions containing WPILib. diff --git a/source/docs/software/vscode-overview/wpilib-commands-vscode.rst b/source/docs/software/vscode-overview/wpilib-commands-vscode.rst index ebd52804e1..87406a08c2 100644 --- a/source/docs/software/vscode-overview/wpilib-commands-vscode.rst +++ b/source/docs/software/vscode-overview/wpilib-commands-vscode.rst @@ -28,7 +28,7 @@ To access these commands, press Ctrl+Shift+P to open the Command Palette, then b - **WPILib: Manage Vendor Libraries** - Install/update 3rd party libraries - **WPILib: Open API Documentation** - Opens either the WPILib Javadocs or C++ Doxygen documentation - **WPILib: Open Project Information** - Opens a widget with project information (Project version, extension version, etc.) -- **WPILib: Open WPILib Command Palette** - This command is used to open a WPILib Command Palette (equivalent of hitting Ctrl+Shift+P and typing WPILib) +- **WPILib: Open WPILib Command Palette** - This command is used to open a WPILib Command Palette (equivalent of hitting :kbd:`Ctrl+Shift+P` and typing ``WPILib``) - **WPILib: Open WPILib Help** - This opens a simple page which links to the WPILib documentation (this site) - **WPILib: Reset Ask for WPILib Updates Flag** - This will clear the flag on the current project, allowing you to re-prompt to update a project to the latest WPILib version if you previously chose to not update. - **WPILib: Run a command in Gradle** - This lets you run an arbitrary command in the GradleRIO command environment diff --git a/source/docs/software/wpilib-tools/robotbuilder/introduction/starting-robotbuilder.rst b/source/docs/software/wpilib-tools/robotbuilder/introduction/starting-robotbuilder.rst index f2485d9025..90bb55f3e3 100644 --- a/source/docs/software/wpilib-tools/robotbuilder/introduction/starting-robotbuilder.rst +++ b/source/docs/software/wpilib-tools/robotbuilder/introduction/starting-robotbuilder.rst @@ -15,7 +15,7 @@ Option 1 - Starting from Visual Studio Code .. image:: images/starting-robotbuilder-1.png -Press **Ctrl + Shift + P** and type WPILib or click the WPILib logo in the top right to launch the WPILib Command Palette and select **Start Tool**, then select **Robot Builder**. +Press :kbd:`Ctrl+Shift+P` and type ``WPILib`` or click the :guilabel:`WPILib logo` in the top right to launch the WPILib Command Palette and select **Start Tool**, then select **Robot Builder**. Option 2 - Running from the Script ---------------------------------- diff --git a/source/docs/software/wpilib-tools/smartdashboard/verifying-smartdashboard-is-working.rst b/source/docs/software/wpilib-tools/smartdashboard/verifying-smartdashboard-is-working.rst index 784e491111..f678b77c43 100644 --- a/source/docs/software/wpilib-tools/smartdashboard/verifying-smartdashboard-is-working.rst +++ b/source/docs/software/wpilib-tools/smartdashboard/verifying-smartdashboard-is-working.rst @@ -62,7 +62,7 @@ Verifying Program using OutlineViewer You can verify that the robot program is generating SmartDashboard values by using the OutlineViewer program. This is a Java program, ``OutlineViewer.jar``, that is located in ``~/wpilib/YYYY/tools`` (where YYYY is the year and ~ is ``C:\Users\Public`` on Windows). -OutlineViewer is downloaded as part of the WPILib Offline Installer. For more information, see the :ref:`Windows/macOS/Linux installation guides `. In Visual Studio Code, press **Ctrl + Shift + P** and type WPILib or click the WPILib logo in the top right to launch the WPILib Command Palette and select **Start Tool**, then select **OutlineViewer**. +OutlineViewer is downloaded as part of the WPILib Offline Installer. For more information, see the :ref:`Windows/macOS/Linux installation guides `. In Visual Studio Code, press :kbd:`Ctrl+Shift+P` and type WPILib or click the WPILib logo in the top right to launch the WPILib Command Palette and select **Start Tool**, then select **OutlineViewer**. In the host box, enter your roboRIO hostname (``roboRIO-####.local`` where ``####`` is your team number with no leading zeroes). Then, click ``Start Client``. diff --git a/source/docs/zero-to-robot/step-4/creating-benchtop-test-program-cpp-java.rst b/source/docs/zero-to-robot/step-4/creating-benchtop-test-program-cpp-java.rst index 5b86f2fed7..a9d3c13e28 100644 --- a/source/docs/zero-to-robot/step-4/creating-benchtop-test-program-cpp-java.rst +++ b/source/docs/zero-to-robot/step-4/creating-benchtop-test-program-cpp-java.rst @@ -6,7 +6,7 @@ Once everything is installed, we're ready to create a robot program. WPILib com Creating a New WPILib Project ----------------------------- -Bring up the Visual Studio Code command palette with :kbd:`Control+Shift+P`: +Bring up the Visual Studio Code command palette with :kbd:`Ctrl+Shift+P`: |Command Palette| @@ -40,7 +40,7 @@ Once all the above have been configured, click "Generate Project" and the robot Opening The New Project ----------------------- -After successfully creating your project, VS Code will give the option of opening the project as shown below. We can choose to do that now or later by typing :kbd:`Ctrl-K` then :kbd:`Ctrl-O` (or just :kbd:`Command+O` on macOS) and select the folder where we saved our project. +After successfully creating your project, VS Code will give the option of opening the project as shown below. We can choose to do that now or later by typing :kbd:`Ctrl+K` then :kbd:`Ctrl+O` (or just :kbd:`Command+O` on macOS) and select the folder where we saved our project. Once opened we will see the project hierarchy on the left. Double clicking on the file will open that file in the editor.