Skip to content

Commit

Permalink
Merge pull request #131 from tgodzik/update-docs
Browse files Browse the repository at this point in the history
Update VS code documentation
  • Loading branch information
tgodzik authored Jul 22, 2019
2 parents daa523c + db5fcc2 commit e8d5e63
Showing 1 changed file with 31 additions and 28 deletions.
59 changes: 31 additions & 28 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ following table shows the status of various features.

## Requirements

**OpenJDK or Oracle Java 8**. Eclipse OpenJ9 and Java 11 are not
supported, please make sure the `JAVA_HOME` environment variable
points to valid Java 8 installation.
**Java 8 or 11 provided by OpenJDK or Oracle**. Eclipse OpenJ9 is not supported,
please make sure the `JAVA_HOME` environment variable points to a valid Java 8
or 11 installation.

**macOS, Linux or Windows**. Metals is developed on macOS and every PR is
tested on Ubuntu+Windows.
**macOS, Linux or Windows**. Metals is developed on macOS and every PR is tested
on Ubuntu+Windows.

**Scala 2.13, 2.12 and 2.11**. Metals supports these Scala versions 2.13.0, 2.12.8, 2.12.7 and 2.11.12.
Note that 2.11.x support is deprecated and it will be removed in future releases.
It's recommended to upgrade to Scala 2.12 or Scala 2.13
**Scala 2.13, 2.12 and 2.11**. Metals supports these Scala versions 2.13.0,
2.12.8, 2.12.7 and 2.11.12. Note that 2.11.x support is deprecated and it will
be removed in future releases. It's recommended to upgrade to Scala 2.12 or
Scala 2.13

## Installation

Expand All @@ -55,20 +56,20 @@ Install the Metals extension from the
Next, open a directory containing a `build.sbt` file. The extension activates
when a `*.scala` or `*.sbt` file is opened.


## Importing a build

The first time you open Metals in a new workspace it prompts you to import the build.
Click "Import build" to start the installation step.
The first time you open Metals in a new workspace it prompts you to import the
build. Click "Import build" to start the installation step.

![Import build](https://i.imgur.com/0VqZWay.png)

- "Not now" disables this prompt for 2 minutes.
- "Don't show again" disables this prompt forever, use `rm -rf .metals/` to re-enable
the prompt.
- "Don't show again" disables this prompt forever, use `rm -rf .metals/` to
re-enable the prompt.
- Use `tail -f .metals/metals.log` to watch the build import progress.
- Behind the scenes, Metals uses [Bloop](https://scalacenter.github.io/bloop/) to
import sbt builds, but you don't need Bloop installed on your machine to run this step.
- Behind the scenes, Metals uses [Bloop](https://scalacenter.github.io/bloop/)
to import sbt builds, but you don't need Bloop installed on your machine to
run this step.

Once the import step completes, compilation starts for your open `*.scala`
files.
Expand All @@ -78,24 +79,26 @@ goto definition.

### Custom sbt launcher

By default, Metals runs an embedded `sbt-launch.jar` launcher that respects `.sbtopts` and `.jvmopts`.
However, the environment variables `SBT_OPTS` and `JAVA_OPTS` are not respected.
By default, Metals runs an embedded `sbt-launch.jar` launcher that respects
`.sbtopts` and `.jvmopts`. However, the environment variables `SBT_OPTS` and
`JAVA_OPTS` are not respected.

Update the "Sbt Script" setting to use a custom `sbt` script instead of the
default Metals launcher if you need further customizations like reading environment
variables.
default Metals launcher if you need further customizations like reading
environment variables.

![Sbt Launcher](https://i.imgur.com/NuwEBe4.png)

### Speeding up import

The "Import build" step can take a long time, especially the first time you
run it in a new build. The exact time depends on the complexity of the build and
if library dependencies need to be downloaded. For example, this step can take
The "Import build" step can take a long time, especially the first time you run
it in a new build. The exact time depends on the complexity of the build and if
library dependencies need to be downloaded. For example, this step can take
everything from 10 seconds in small cached builds up to 10-15 minutes in large
uncached builds.

Consult the [Bloop documentation](https://scalacenter.github.io/bloop/docs/build-tools/sbt#speeding-up-build-export)
Consult the
[Bloop documentation](https://scalacenter.github.io/bloop/docs/build-tools/sbt#speeding-up-build-export)
to learn how to speed up build import.

### Importing changes
Expand All @@ -105,7 +108,6 @@ re-import the build.

![Import sbt changes](https://i.imgur.com/72kdZkL.png)


### Manually trigger build import

To manually trigger a build import, execute the "Import build" command through
Expand Down Expand Up @@ -181,6 +183,9 @@ See
https://scalameta.org/metals/docs/editors/vscode.html#using-latest-metals-snapshot
to find the latest SNAPSHOT version.

Run the "Reload Window" command after updating the setting for the new version
to take effect.

## Gitignore `.metals/` and `.bloop/`

The Metals server places logs and other files in the `.metals/` directory. The
Expand All @@ -194,7 +199,6 @@ systems like git.
.bloop/
```


## Show document symbols

Run the "Explorer: Focus on Outline View" command to open the symbol outline for
Expand All @@ -216,12 +220,11 @@ Install the
[IntelliJ IDEA Keybindings](https://marketplace.visualstudio.com/items?itemName=k--kato.intellij-idea-keybindings)
extension to use default IntelliJ shortcuts with VS Code.

| IntelliJ | VS Code |
|------------------|---------------------------|
| IntelliJ | VS Code |
| ---------------- | ------------------------- |
| Go to class | Go to symbol in workspace |
| Parameter info | Trigger parameter hints |
| Basic completion | Trigger suggest |
| Type info | Show hover |
| Expand | Fold |
| Extend Selection | Expand selection |

0 comments on commit e8d5e63

Please sign in to comment.