Skip to content

Commit

Permalink
Merge branch 'main' into fix-doctor-http-start
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Jan 24, 2025
2 parents a5951fd + a3b9f73 commit 3794b0b
Show file tree
Hide file tree
Showing 159 changed files with 2,457 additions and 1,463 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ cb3a4275b4536030d133d19be4fd1d4b1aa9135b

# Scala Steward: Reformat with scalafmt 3.8.3
1667f8439baa406ca22af4ebc585b7342ea0ee70

# Scala Steward: Reformat with scalafmt 3.8.5
9105db9a4c85b101a3def29b7e6fc458a5afda71
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ body:
id: version
attributes:
label: Version of Metals
placeholder: v1.4.2
placeholder: v1.5.1
validations:
required: true

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/mtags-auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ on:
metals_version:
description: "Metals Version"
required: true
default: "v1.4.2"
default: "v1.5.1"
metals_ref:
description: "Tag/branch-name from which run release"
required: true
# If you update this line after release
# just put the tag name (`v*.*.*`) here as in `metals_version.value` above.
# Don't be confused if this value contains `*.*.*_mtags_release`
default: "v1.4.2"
default: "v1.5.1"
jobs:
test_and_release:
runs-on: ubuntu-latest
Expand All @@ -30,6 +30,7 @@ jobs:
distribution: 'temurin'
java-version: 11
cache: 'sbt'
- uses: sbt/setup-sbt@v1
- name: "Test and push tag"
run: |
sbt 'test-mtags-dyn ${{ github.event.inputs.scala_version }}'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
# Do not change the version of Java, it is the minimal version Metals works with
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@v1
- name: Publish
run: |
COMMAND="ci-release"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sbt-dependency-graph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: sbt/setup-sbt@v1
- uses: scalacenter/sbt-dependency-submission@v3
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.8.3"
version = "3.8.6"
runner.dialect = scala213source3
project.git = true
align.preset = none
Expand Down
2 changes: 1 addition & 1 deletion bin/merged_prs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import org.kohsuke.github.GHIssueState
import java.text.SimpleDateFormat
import java.util.Date

val codename = "Palladium"
val codename = "Strontium"

@main
def main(
Expand Down
5 changes: 2 additions & 3 deletions bin/test-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ suffix=${argumentsRest:-}

coursier fetch \
org.scalameta:metals_2.13:$version \
org.scalameta:mtags_3.2.2:$version \
org.scalameta:mtags_3.3.2:$version \
org.scalameta:mtags_3.3.1:$version \
org.scalameta:mtags_3.3.3:$version \
org.scalameta:mtags_2.13.11:$version \
org.scalameta:mtags_2.13.12:$version \
org.scalameta:mtags_2.13.13:$version \
org.scalameta:mtags_2.13.14:$version \
org.scalameta:mtags_2.13.15:$version \
org.scalameta:mtags_2.13.16:$version \
org.scalameta:mtags_2.12.17:$version \
org.scalameta:mtags_2.12.18:$version \
org.scalameta:mtags_2.12.19:$version \
Expand Down
4 changes: 2 additions & 2 deletions bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ cat ~/.local/share/scalacli/bloop/daemon/output

rm .jvmopts
touch .jvmopts
echo "-Xss4m" >> .jvmopts
echo "-Xmx1G" >> .jvmopts
echo "-Xss4m" >> .jvmopts
echo "-Xmx2G" >> .jvmopts
echo "-XX:ReservedCodeCacheSize=1024m" >> .jvmopts
echo "-XX:+TieredCompilation" >> .jvmopts
echo "-Dfile.encoding=UTF-8" >> .jvmopts
Expand Down
6 changes: 3 additions & 3 deletions bin/update-millw.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env sh
# NOTE: Run this from the root of metals ./bin/update-millw.sh

root_url=https://raw.githubusercontent.com/lefou/millw/main
root_url=https://raw.githubusercontent.com/com-lihaoyi/mill/main

curl $root_url/millw > $PWD/metals/src/main/resources/millw
curl $root_url/millw.bat > $PWD/metals/src/main/resources/millw.bat
curl $root_url/mill > $PWD/metals/src/main/resources/mill
curl $root_url/mill.bat > $PWD/metals/src/main/resources/mill.bat
14 changes: 7 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Global / onChangedBuildSource := ReloadOnSourceChanges
Global / resolvers += "scala-integration" at
"https://scala-ci.typesafe.com/artifactory/scala-integration/"

def localSnapshotVersion = "1.4.3-SNAPSHOT"
def localSnapshotVersion = "1.5.2-SNAPSHOT"
def isCI = System.getenv("CI") != null
def isTest = System.getenv("METALS_TEST") != null

Expand Down Expand Up @@ -198,6 +198,7 @@ val sharedScalacOptions = List(
)

val sharedSettings = sharedJavacOptions ++ sharedScalacOptions ++ List(
Compile / doc / sources := Seq.empty,
libraryDependencies ++= crossSetting(
scalaVersion.value,
if2 = List(
Expand All @@ -221,6 +222,7 @@ lazy val interfaces = project
mimaPreviousArtifacts := Set(
"org.scalameta" % "mtags-interfaces" % "1.2.2",
"org.scalameta" % "mtags-interfaces" % "1.3.2",
"org.scalameta" % "mtags-interfaces" % "1.4.2",
),
crossPaths := false,
libraryDependencies ++= List(
Expand Down Expand Up @@ -259,7 +261,7 @@ lazy val mtagsShared = project
},
libraryDependencies ++= List(
"org.lz4" % "lz4-java" % "1.8.0",
"com.google.protobuf" % "protobuf-java" % "4.29.2",
"com.google.protobuf" % "protobuf-java" % "4.29.3",
V.guava,
"io.get-coursier" % "interface" % V.coursierInterfaces,
),
Expand Down Expand Up @@ -316,8 +318,6 @@ val mtagsSettings = List(
(ThisBuild / baseDirectory).value / "mtags",
scalaVersion.value,
),
// @note needed to deal with issues with dottyDoc
Compile / doc / sources := Seq.empty,
libraryDependencies ++= Seq(
"com.lihaoyi" %% "geny" % V.genyVersion,
"com.thoughtworks.qdox" % "qdox" % V.qdox, // for java mtags
Expand All @@ -342,7 +342,7 @@ val mtagsSettings = List(
scala3ScalametaDependency,
scala3SemanticdbDependency,
),
),
)
},
libraryDependencies ++= {
if (isCI) Nil
Expand Down Expand Up @@ -427,7 +427,7 @@ lazy val metals = project
"io.undertow" % "undertow-core" % "2.2.20.Final",
"org.jboss.xnio" % "xnio-nio" % "3.8.16.Final",
// for persistent data like "dismissed notification"
"org.flywaydb" % "flyway-core" % "11.1.0",
"org.flywaydb" % "flyway-core" % "11.2.0",
"com.h2database" % "h2" % "2.3.232",
// for BSP
"org.scala-sbt.ipcsocket" % "ipcsocket" % "1.6.3",
Expand Down Expand Up @@ -457,7 +457,7 @@ lazy val metals = project
"com.outr" %% "scribe-file" % V.scribe,
"com.outr" %% "scribe-slf4j2" % V.scribe, // needed for flyway database migrations
// for JSON formatted doctor
"com.lihaoyi" %% "ujson" % "4.0.2",
"com.lihaoyi" %% "ujson" % "4.1.0",
// For fetching projects' templates
"com.lihaoyi" %% "requests" % "0.9.0",
// for producing SemanticDB from Scala source files, to be sure we want the same version of scalameta
Expand Down
3 changes: 0 additions & 3 deletions docs/editors/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,6 @@ notification.

**Quick pick**: Editor client implements the `metals/quickPick` request.

**Window state**: Editor client implements the `metals/windowStateDidChange`
notification.

****: Editor implements all Metals extension endpoints.

The Metals language server supports custom extensions that are not part of the
Expand Down
2 changes: 1 addition & 1 deletion docs/editors/vscode.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ It is also possible to opt in to install the pre-release version and try out the
latest cutting edge features from Metals server. Apart from new features,
pre-release versions also include many bugfixes. It's encouraged to use them
with [SNAPSHOT](#SNAPSHOT) releases of Metals server. Using pre-release versions
may result in less stable experience and it is not indented for beginners.
may result in less stable experience and it is not intented for beginners.
Pre-release versions follow `major.minor.PATCH` versioning.

![Install the pre-release extension](https://imgur.com/CzOTleE.png)
Expand Down
19 changes: 0 additions & 19 deletions docs/integrations/new-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -879,25 +879,6 @@ export interface MetalsQuickPickResult {
}
```

### `metals/windowStateDidChange`

The `metals/windowStateDidChange` notification is sent from the client to the
server to indicate whether the editor application window is focused or not. When
the editor window is not focused, Metals tries to avoid triggering expensive
computation in the background such as compilation.

_Notification_:

- method: `metals/windowStateDidChange`
- params: `WindowStateDidChangeParams` defined as follows:

```ts
interface WindowStateDidChangeParams( {
/** If true, the editor application window is focused. False, otherwise. */
focused: boolean;
}
```

### `metals/openWindow`

The `metals/openWindow` params are used with the New Scala Project
Expand Down
2 changes: 1 addition & 1 deletion metals-bench/src/main/scala/bench/MetalsBench.scala
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class MetalsBench {
def mtagsJavaParse(): Unit = {
javaDependencySources.foreach { input =>
JavaMtags
.index(input, includeMembers = true)
.index(input, includeMembers = true)(EmptyReportContext)
.index()
}
}
Expand Down
10 changes: 5 additions & 5 deletions metals-docs/src/main/scala/docs/WorksheetModifier.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ class WorksheetModifier extends StringModifier {
|it in one of the following two ways.
|
|```scala
|// $$dep.`organisation`::artifact:version` style
|import $$dep.`com.lihaoyi::scalatags:0.7.0`
|// $dep.`organisation::artifact:version` style
|import $dep.`com.lihaoyi::scalatags:0.7.0`
|
|// $$ivy.`organisation::artifact:version` style
|import $$ivy.`com.lihaoyi::scalatags:0.7.0`
|// $ivy.`organisation::artifact:version` style
|import $ivy.`com.lihaoyi::scalatags:0.7.0`
|```
|
|`::` is the same as `%%` in sbt, which will append the current Scala binary version
Expand All @@ -60,7 +60,7 @@ class WorksheetModifier extends StringModifier {
|You can also import `scalac` options in a special `$$scalac` import like below:
|
|```scala
|import $$scalac.`-Ywarn-unused`
|import $scalac.`-Ywarn-unused`
|```
|
|### Troubleshooting
Expand Down
31 changes: 24 additions & 7 deletions metals/src/main/resources/millw → metals/src/main/resources/mill
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# You can give the required mill version with --mill-version parameter
# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION
#
# Project page: https://github.com/lefou/millw
# Script Version: 0.4.11
# Original Project page: https://github.com/lefou/millw
# Script Version: 0.4.12
#
# If you want to improve this script, please also contribute your changes back!
#
Expand Down Expand Up @@ -49,9 +49,9 @@ fi
# If not already set, read .mill-version file
if [ -z "${MILL_VERSION}" ] ; then
if [ -f ".mill-version" ] ; then
MILL_VERSION="$(head -n 1 .mill-version 2> /dev/null)"
MILL_VERSION="$(tr '\r' '\n' < .mill-version | head -n 1 2> /dev/null)"
elif [ -f ".config/mill-version" ] ; then
MILL_VERSION="$(head -n 1 .config/mill-version 2> /dev/null)"
MILL_VERSION="$(tr '\r' '\n' < .config/mill-version | head -n 1 2> /dev/null)"
fi
fi

Expand Down Expand Up @@ -101,7 +101,24 @@ if [ -z "${MILL_VERSION}" ] ; then
fi
fi

MILL="${MILL_DOWNLOAD_PATH}/${MILL_VERSION}"
MILL_NATIVE_SUFFIX="-native"
FULL_MILL_VERSION=$MILL_VERSION

case "$MILL_VERSION" in
*"$MILL_NATIVE_SUFFIX")
MILL_VERSION=${MILL_VERSION%"$MILL_NATIVE_SUFFIX"}
if [ "$(expr substr $(uname -s) 1 5 2>/dev/null)" = "Linux" ]; then
ARTIFACT_SUFFIX="-native-linux-amd64"
elif [ "$(uname)" = "Darwin" ]; then
ARTIFACT_SUFFIX="-native-mac-aarch64"
else
echo "This native mill launcher supports only Linux and macOS." 1>&2
exit 1
fi
esac


MILL="${MILL_DOWNLOAD_PATH}/${FULL_MILL_VERSION}"

try_to_use_system_mill() {
if [ "$(uname)" != "Linux" ]; then
Expand Down Expand Up @@ -200,7 +217,7 @@ if [ ! -s "${MILL}" ] ; then
DOWNLOAD_FILE=$(mktemp mill.XXXXXX)

if [ "$DOWNLOAD_FROM_MAVEN" = "1" ] ; then
DOWNLOAD_URL="https://repo1.maven.org/maven2/com/lihaoyi/mill-dist/${MILL_VERSION}/mill-dist-${MILL_VERSION}.jar"
DOWNLOAD_URL="https://repo1.maven.org/maven2/com/lihaoyi/mill-dist${ARTIFACT_SUFFIX}/${MILL_VERSION}/mill-dist${ARTIFACT_SUFFIX}-${MILL_VERSION}.jar"
else
MILL_VERSION_TAG=$(echo "$MILL_VERSION" | sed -E 's/([^-]+)(-M[0-9]+)?(-.*)?/\1\2/')
DOWNLOAD_URL="${GITHUB_RELEASE_CDN}${MILL_REPO_URL}/releases/download/${MILL_VERSION_TAG}/${MILL_VERSION}${DOWNLOAD_SUFFIX}"
Expand Down Expand Up @@ -238,4 +255,4 @@ unset MILL_REPO_URL

# We don't quote MILL_FIRST_ARG on purpose, so we can expand the empty value without quotes
# shellcheck disable=SC2086
exec "${MILL}" $MILL_FIRST_ARG -D "mill.main.cli=${MILL_MAIN_CLI}" "$@"
exec "${MILL}" $MILL_FIRST_ARG -D "mill.main.cli=${MILL_MAIN_CLI}" "$@"
Loading

0 comments on commit 3794b0b

Please sign in to comment.