3.12 FAQ
Q: I cannot see my R Objects in the global environment.
A: when you click on “R: (not attached)” on the bottom bar or type .vsc.attach() into the terminal, your objects should start showing up in your global environment.
Q: How to hide variables in OUTLINE view?
A: OUTLINE view by default shows all variables in the current R script, making it difficult to locate your true sections. To hide variables, go to command palette, type “Outline: Show”, there is a list of objects that you can choose to show or hide (you can choose to set this for workspace or the user). Here is my current setting:
{
"outline.showArrays": false,
"outline.showBooleans": false,
"outline.showClasses": true,
"outline.showConstants": false,
"outline.showFields": false // this hides most variables you actually don't want to see
}Note that some answers mention that you should use
"outline.showVariables": false, but this does NOT work for me. Instead, I use"outline.showFields": falseto hide most variables.
To set outline appearance for a specific language, you can use the following settings:
{
"[r]": {
"outline.showArrays": false,
"outline.showBooleans": false,
"outline.showClasses": true,
"outline.showConstants": false,
"outline.showFields": false
},
"[rmd]": {
"outline.showKeys": false,
}
}- Set
outline.showKeysto false will prevent code chunks from being shown in the OUTLINE view of Rmd files.
Multiple language specific editor settings
You can now configure language specific editor settings for multiple languages at once. The following example shows how you can customize settings for javascript and typescript languages together in your settings.json file:
See HERE for a complete list of icons and their meanings in the OUTLINE view.
The following tables shows the icons that you most commonly see in the OUTLINE view.
| Icon | Name | Symbol type |
|---|---|---|
| Methods and Functions |
method, function, constructor
|
|
| Variables |
variable
|
|
| Fields |
field
|
|
| Words |
text
|
|
| Constants |
constant
|
|
| Classes |
class
|
|
| Structures |
struct
|
|
| Modules |
module
|
|
| Properties and Attributes |
property
|
- Constant applies to Quarto sections. Need to set
"outline.showConstants": true,to show sections properly in the OUTLINE view.
References:
- R in Visual Studio Code
- Set up
vscode-R: - Getting started with
httpgd: https://nx10.github.io/httpgd/articles/getting-started.html - Bookdown in VS code: https://www.bendirt.com/bookdown/
- Jupyter Notebooks in VS Code