Skip to content

Commit 51a917c

Browse files
committed
feat: add vscode how-to page
1 parent 75f822d commit 51a917c

4 files changed

Lines changed: 87 additions & 20 deletions

File tree

docs/how-to/general/vscode.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
related:
3+
- title: Add Changes to Your Plugin
4+
url: how-to/git/add-changes-to-plugin-repository.html
5+
- title: Install BEC Locally
6+
url: how-to/general/install-bec-locally.html
7+
---
8+
9+
# Work with VS Code
10+
11+
!!! Info "Overview"
12+
This is a how-to guide on using VS Code for working with your BEC plugin.
13+
14+
## Prerequisites
15+
16+
- You have write access to your beamline plugin directory, for example `/sls/<xname>/config/bec/production/<plugin_name>`.
17+
- If you don't have write access, you can still use VS Code to create and edit files outside of the deployment but you cannot modify the plugin repository directly.
18+
19+
## Open VS Code in the correct folder
20+
21+
Opening the correct folder is important for VS Code to work well. We highly recommend opening the deployment directory:
22+
23+
/// tab | Template
24+
```bash
25+
cd /sls/<xname>/config/bec/<deployment_name>
26+
code .
27+
```
28+
///
29+
30+
/// tab | Example
31+
```bash
32+
cd /sls/x01da/config/bec/production
33+
code .
34+
```
35+
///
36+
37+
This ensures that VS Code finds the already prepared settings.json file with the correct Python environment.
38+
39+
<figure markdown="span" style="padding: 0.75rem 0;">
40+
![RecommendedExtensions](./vscode_assets/vscode_startup.png){width="90%"}
41+
</figure>
42+
43+
## Install recommended extensions
44+
45+
When you open the deployment folder, VS Code will prompt you to install recommended extensions. We recommend installing them.
46+
47+
<figure markdown="span" style="padding: 0.75rem 0;">
48+
![RecommendedExtensions](./vscode_assets/vscode_startup_extensions.png){width="90%"}
49+
</figure>
50+
51+
52+
This will give you access to Python language support, formatters, linters but also H5Web for previewing HDF5 files.
53+
54+
55+
## Common Pitfalls
56+
57+
- If Python syntax highlighting and auto-completion are not working, check that you have the Python extension installed and that the correct directory is open.
58+
- If you cannot edit files in the deployment, check that you have write access to the deployment directory. Experiment accounts usually do not have write access to the production deployment, so you may need to log in with your personal account.
59+
60+
## Next Steps
61+
62+
- Continue with [Add Changes to Your Plugin](../git/add-changes-to-plugin-repository.md) if you
63+
want to commit and push your changes.
64+
65+
!!! success "Congratulations!"
66+
You have successfully set up VS Code for working with your BEC plugin.
168 KB
Loading
22.4 KB
Loading

zensical.toml

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ nav = [
3838
"how-to/index.md",
3939
{ "Setup and Maintenance" = [
4040
{ "Update BEC" = "how-to/general/update-deployment.md" },
41+
{ "Work with VS Code" = "how-to/general/vscode.md" },
4142
{ "Add Changes to Your Plugin" = "how-to/git/add-changes-to-plugin-repository.md" },
4243
{ "Merge Changes to main" = "how-to/git/merge-changes-to-main.md" },
43-
{ "Set the Active Account" = "how-to/general/set-the-active-account-with-bec-set-account.md" },
44+
{ "Set the Active Account" = "how-to/general/set-the-active-account-with-bec-set-account.md" },
4445
{ "Connect to the BEC VM" = "how-to/general/connect-to-the-bec-vm-with-xfreerdp.md" },
4546
{ "Install BEC Locally" = "how-to/general/install-bec-locally.md" },
4647
] },
@@ -62,29 +63,29 @@ nav = [
6263
] },
6364
] },
6465
{ "Devices" = [
65-
{ "Usage" = [
66+
{ "Usage" = [
6667
{ "Adding Devices" = [
6768
{ "Add an EPICS Motor" = "how-to/devices/add-an-epics-motor.md" },
6869
{ "Add an EPICS Signal" = "how-to/devices/add-an-epics-signal.md" },
6970
{ "Add a Pseudo Positioner" = "how-to/devices/add-a-pseudo-motor.md" },
7071
] },
7172
{ "Configs and Session" = [
72-
{ "Inspect the Current Device Session" = "how-to/devices/inspect-the-current-device-session-from-the-bec-ipython-client.md" },
73-
{ "Inspect a Device from the BEC IPython Client" = "how-to/devices/inspect-a-device-from-the-bec-ipython-client.md" },
74-
{ "Load and Save a Device Session" = "how-to/devices/load-and-save-a-device-session-from-the-bec-ipython-client.md" },
75-
{ "Change Config Signals from the BEC IPython Client" = "how-to/devices/change-config-signals-from-the-bec-ipython-client.md" },
76-
{ "Validate a YAML configuration" = "how-to/devices/validate-a-yaml-config-file.md" },
77-
] },
78-
]},
79-
{ "Development" = [
80-
{ "Readout Behavior" = [
81-
{ "Select a Signal Kind" = "how-to/devices/how-to-select-an-ophyd-kind.md" },
82-
{ "Select a Readout Priority" = "how-to/devices/how-to-select-readout-priority.md" },
73+
{ "Inspect the Current Device Session" = "how-to/devices/inspect-the-current-device-session-from-the-bec-ipython-client.md" },
74+
{ "Inspect a Device from the BEC IPython Client" = "how-to/devices/inspect-a-device-from-the-bec-ipython-client.md" },
75+
{ "Load and Save a Device Session" = "how-to/devices/load-and-save-a-device-session-from-the-bec-ipython-client.md" },
76+
{ "Change Config Signals from the BEC IPython Client" = "how-to/devices/change-config-signals-from-the-bec-ipython-client.md" },
77+
{ "Validate a YAML configuration" = "how-to/devices/validate-a-yaml-config-file.md" },
78+
] },
8379
] },
84-
{ "Simulation" = [
85-
{ "Use Simulated Models from the IPython Client" = "how-to/devices/use-simulated-models-from-ipython.md" },
80+
{ "Development" = [
81+
{ "Readout Behavior" = [
82+
{ "Select a Signal Kind" = "how-to/devices/how-to-select-an-ophyd-kind.md" },
83+
{ "Select a Readout Priority" = "how-to/devices/how-to-select-readout-priority.md" },
84+
] },
85+
{ "Simulation" = [
86+
{ "Use Simulated Models from the IPython Client" = "how-to/devices/use-simulated-models-from-ipython.md" },
87+
] },
8688
] },
87-
]}
8889
] },
8990
{ "Data Access" = [
9091
{ "Access BEC History" = "how-to/scans/access-bec-history.md" },
@@ -108,21 +109,21 @@ nav = [
108109
{ "Concepts" = [
109110
{ "Introduction to ophyd" = "learn/devices/introduction-to-ophyd.md" },
110111
{ "Device Sessions" = "learn/devices/device-sessions-in-bec.md" },
111-
]},
112+
] },
112113
{ "Usage" = [
113114
{ "Ophyd Kind Values" = "learn/devices/ophyd-kinds.md" },
114115
{ "Readout Priority" = "learn/devices/readout-priority.md" },
115116
{ "Device Config" = "learn/devices/device-config-in-bec.md" },
116-
{ "Error Handling during Session Updates" = "learn/devices/error-handling-during-session-updates.md"},
117+
{ "Error Handling during Session Updates" = "learn/devices/error-handling-during-session-updates.md" },
117118
{ "Managing YAML Configs" = "learn/devices/managing-yaml-configs.md" },
118119
{ "EPICS Motor Variants" = "learn/devices/epics-motors.md" },
119120
{ "EPICS Signal Variants" = "learn/devices/epics-signals.md" },
120-
]},
121+
] },
121122
{ "Development" = [
122123
{ "Pseudo Positioners" = "learn/devices/pseudo-positioners.md" },
123124
{ "BEC Signals" = "learn/devices/bec-signals.md" },
124125
{ "Simulated Devices" = "learn/devices/simulated-devices.md" },
125-
]},
126+
] },
126127
] },
127128
#{ "Scans and execution" = [ TODO fill with content
128129
#] },

0 commit comments

Comments
 (0)