Skip to content

Commit b433a01

Browse files
committed
Example settings.
1 parent 424ed29 commit b433a01

File tree

1 file changed

+55
-75
lines changed

1 file changed

+55
-75
lines changed

lectures/software_engineering/tools_editors.md

Lines changed: 55 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,72 @@ kernelspec:
1818
</div>
1919
```
2020

21-
# Julia Tools and Editors
21+
# Visual Studio Code and other Julia Tools
2222

2323
```{contents} Contents
2424
:depth: 2
2525
```
2626

27-
Co-authored with Arnav Sood
27+
While Jupyter notebooks are a great way to get started with the language, eventually you will want to use more powerful tools. Visual Studio Code (VS Code) in particular, is the most popular open source editor for programming, and has a huge set of extensions and strong industry support.
2828

29-
While Jupyter notebooks are a great way to get started with the language, eventually you will want to use more powerful tools.
29+
While you can use source code control, run terminals/REPLs, without VS Code, we will concentrate on using it as a full IDE for all of these features.
3030

31-
We'll discuss a few of them here, such as
31+
## Installing VS Code
3232

33-
* Text editors like Atom, which come with rich Julia support for debugging, documentation, git integration, plotting and inspecting data, and code execution.
34-
* The Julia REPL, which has specialized modes for package management, shell commands, and help.
33+
To install VS Code and the Julia Extension,
34+
35+
1. Follow the instructions for setting up Julia {ref}`on your local computer <jl_jupyterlocal>`.
36+
2. Install [VS Code](https://code.visualstudio.com/) for your platform and open it
37+
3. Install the [VS Code Julia](https://marketplace.visualstudio.com/items?itemName=julialang.language-julia) extension
38+
- After installation of VS Code, you should be able to choose `Install` on the webpage of any extensions and it will open on your desktop.
39+
- Otherwise, open the extensions with `<Ctrl-Shift-X>` or selecting extensions in the left-hand side of the VS Code window. Then search for `Julia` in the Marketplace
40+
41+
See the [Julia VS Code Documentation](https://www.julia-vscode.org/docs/dev/gettingstarted/#Installation-and-Configuration-1) for more details.
42+
43+
If you have done a typical Julia installation, then this may be all that is needed and no configuration may be necessary. However, if you have installed Julia in a non-standard location you may need to manually set the executable path. See [here](https://www.julia-vscode.org/docs/dev/gettingstarted/#Configuring-the-Julia-extension-1) for instructions if it errors when starting Julia terminals.
44+
45+
### Optional Extensions
46+
47+
While not required for these lectures, consider installing the following extensions. As before, you can search for them on the Marketplace or choose `Install` from the webpages themselves.
48+
49+
1. [Jupyter](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter): VS Code increasingly supports Jupyter notebooks directly, and this extension provides the ability to open and edit `.ipynb` notebook files wihtout running `jupyter lab`, etc.
50+
1. [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens): An extension that provides an enormous amount of detail on exact code changes within github repositories (e.g., seamless information on the time and individual who [last modified](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#current-line-blame-) each line of code)
51+
2. [GitHub Pull Requests and Issues](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github): while VS Code supports the git {doc}`version control <../software_engineering/version_control>` natively, these extension provides additional features for working with repositories on GitHub itself.
52+
3. [Markdown All in One](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one): For editing the markdown format, such as `README.md` and similar files.
53+
4. Finally, VS Code is an excellent latex editor. To install support,
54+
- Install a recent version of miktex or texlive for your platform
55+
- Install [LaTeX Workshop](https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop)
56+
- Optionally install [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) for spell checking
57+
- See [documentation](https://github.com/James-Yu/LaTeX-Workshop#manual). The easiest use is to put the magic comment `!TEX program = pdflatex` at the top of a `.tex` file.
58+
-
59+
60+
61+
See the [VS Code documentation](https://code.visualstudio.com/docs/getstarted/userinterface) for an introduction.
62+
63+
A key feature is the [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette), which can be accessed with `<Ctrl+Shift+P>`.
64+
65+
```{figure} [/_static/figures/juno-standard-layout.png](https://code.visualstudio.com/assets/docs/getstarted/userinterface/commands.png)
66+
:width: 50%
67+
```
68+
69+
With this, you can type partial strings for different commands and it helps you to find features of vscode and its extensions. This is so common that in these notes we
70+
denote opening the command palette and searching for a command with things like `> Julia: Start REPL` , etc. You will only need to type part of the string, and the command palette remembers
71+
your most commonly used
72+
73+
74+
### Optional Extensions and Settings
75+
76+
77+
Open the settings, either with `> Preferences: User Settings` (recall this can be found with the palette and `<Ctrl-Shift-P>`) or with the menu.
78+
79+
As a few optional suggestions for working with the settings,
80+
81+
- In the settings, search for `Tab Size` and you should find `Editor: Tab Size` which you can modify to 4.
82+
- Search for `quick open` and change `Workbench > Editor: Enable Preview from Quick Open` and consider setting it to false, though this is a matter of personal taste.
83+
- Finally, if you are on Windows, search for `eol` and change `Files: Eol` to be `\n`.
3584

36-
Note that we assume you've already completed the {doc}`getting started <../getting_started_julia/getting_started>` and {doc}`interacting with Julia <../getting_started_julia/julia_environment>` lectures.
3785

38-
## Preliminary Setup
3986

40-
Follow the instructions for setting up Julia {ref}`on your local computer <jl_jupyterlocal>`.
4187

4288
(repl_main)=
4389
## The REPL
@@ -120,72 +166,6 @@ The most feature-rich one for Julia development is [Atom](https://atom.io/), wit
120166

121167
There are several reasons to use a text editor like Atom, including
122168

123-
* Git integration (more on this in the {doc}`next lecture <../software_engineering/version_control>`).
124-
* Painless inspection of variables and data.
125-
* Easily run code blocks, and drop in custom snippets of code.
126-
* Integration with Julia documentation and plots.
127-
128-
### Installation and Configuration
129-
130-
#### Installing Atom
131-
132-
1. Download and Install Atom from the [Atom website](https://atom.io/).
133-
1. (Optional, but recommended): Change default Atom settings
134-
* Use `Ctrl-,` to get the `Settings` pane
135-
* Choose the `Packages` tab
136-
* Type `line-ending-selector` into the Filter and then click "Settings" for that package
137-
* Change the default line ending to `LF` (only necessary on Windows)
138-
* Choose the Editor tab
139-
* Turn on `Soft Wrap`
140-
* Set the `Tab Length` default to `4`
141-
142-
#### Installing Juno
143-
144-
1. Use `Ctrl-,` to get the Settings pane.
145-
1. Go to the `Install` tab.
146-
1. Type `uber-juno` into the search box and then click Install on the package that appears.
147-
1. Wait while Juno installs dependencies.
148-
1. When it asks you whether or not to use the standard layout, click `yes`.
149-
150-
At that point, you should see a built-in REPL at the bottom of the screen and be able to start using Julia and Atom.
151-
152-
(atom_troubleshooting)=
153-
#### Troubleshooting
154-
155-
Sometimes, Juno will fail to find the Julia executable (say, if it's installed somewhere nonstandard, or you have multiple).
156-
157-
To do this
158-
1. `Ctrl-,` to get Settings pane, and select the Packages tab.
159-
2. Type in `julia-client` and choose Settings.
160-
3. Find the Julia Path, and fill it in with the location of the Julia binary.
161-
162-
* To find the binary, you could run `Sys.BINDIR` in the REPL, then add in an additional `/julia` to the end of the screen.
163-
* e.g. `C:\Users\YOURUSERNAME\AppData\Local\Julia-1.0.1\bin\julia.exe` on Windows as `/Applications/Julia-1.0.app/Contents/Resources/julia/bin/julia` on OSX.
164-
165-
>
166-
167-
See the [setup instructions for Juno](http://docs.junolab.org/latest/man/installation.html) if you have further issues.
168-
169-
If you upgrade Atom and it breaks Juno, run the following in a terminal.
170-
171-
```{code-block} none
172-
apm uninstall ink julia-client
173-
apm install ink julia-client
174-
```
175-
176-
If you aren't able to install `apm` in your PATH, you can do the above by running the following in PowerShell:
177-
178-
```{code-block} none
179-
cd $ENV:LOCALAPPDATA/atom/bin
180-
```
181-
182-
Then navigating to a folder like `C:\Users\USERNAME\AppData\Local\atom\bin` (which will contain the `apm` tool), and running:
183-
184-
```{code-block} none
185-
./apm uninstall ink julia-client
186-
./apm install ink julia-client
187-
```
188-
189169
(upgrading_julia)=
190170
#### Upgrading Julia
191171

0 commit comments

Comments
 (0)