JAVA_HOME
environment variable to locate the java executable. To make sure the VS Code uses the correct JDK version, setup JAVA_HOME
is recommended. Add the following line to ~/.bashrc
.scala-sample-code
folder we just created.scala-sample-code
folder, we can see the left-bottom icon becomes WSL: Ubuntu,
and we can start creating folders and files.build.sbt
with the following content.build.sbt
file is created, the Metals extension of VS Code automatically detects the change and bumps up a window for importing the build..bloop
, .metlas
, and .vscode
are generated by VS Code and Metals extension. If we use a version control system like Git, we should add these folders to .gitignore
.Format Document
to format the file as shown in the picture..scalafmt.conf
file on the project directory’s root. The path can be modified from the Metals extension configuration. See Configurations to alter the settings.run | debug
for main class and test | test debug
for test classes. Click run
or test
to run or test the Scala program.launch.json
for VS Code to run or debug a program.launch.json
configuration file.launch.json
file after the JSON file is created. After the configure file is created, we can fill in the configurations and run or debug the program.[File -> Preference -> Settings]
to open the settings. The settings have three scopes: User, Remote, and Workspace. Choose whichever fits our needs. And select Extensions -> Metals
to modify the settings.Ctrl+Shift+P
to bring up the Command Palette
and type terminal
. It should show a few terminal options. Choose to Create New Integrated Terminal (In Active Workspace)
. Find my iphone using mac.