scalameta / metals

Scala language server with rich IDE features 🚀

Home Page:https://scalameta.org/metals/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'#' character in millw.bat script causes error

Lawdrian opened this issue · comments

Describe the bug

The millw.bat script contains # for a comment, which is an illegal character for windows. This causes the error and thus not downloading mill

Repeat bug

  1. Use metals to create a new scala project (e.g. example project scala/hello-world.g8)
  2. Delete project folder and build.sbt and add build.sc since we want to use mill

import mill., scalalib.

object robot extends ScalaModule {
def scalaVersion = "3.4.1"

def ivyDeps = Agg(ivy"com.lihaoyi::fastparse:3.1.0")
}

  1. Use metals to import the build which will trigger the mill installation

This results in the following error

2024.05.27 13:12:38 INFO running 'P:\Masterstudium\SS24\Methods_In_SoftwareEngineering\tutorial\test\hello-world.metals\millw.bat --mill-version 0.11.7 -i --import ivy:com.lihaoyi::mill-contrib-bloop: mill.contrib.bloop.Bloop/install' 2024.05.27 13:12:38 INFO The command "#" is either misspelled or 2024.05.27 13:12:38 INFO could not be found. 2024.05.27 13:12:38 INFO The command "#" is either misspelled or 2024.05.27 13:12:38 INFO could not be found. 2024.05.27 13:12:38 INFO Downloading mill 0.11.7 from [https://repo1.maven.org/maven2/com/lihaoyi/mill-dist/0.11.7/mill-dist-0.11.7.jar](vscode-file://vscode-app/d:/ProgrammierProgramme/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html) ... 2024.05.27 13:12:38 INFO The command "where" is either misspelled or 2024.05.27 13:12:38 INFO could not be found. 2024.05.27 13:12:38 INFO The command "curl" is either misspelled or 2024.05.27 13:12:38 INFO could not be found. 2024.05.27 13:12:38 INFO Could not download mill 0.11.7 2024.05.27 13:12:38 INFO time: ran 'mill bloopInstall' in 83ms 2024.05.27 13:12:38 WARN Build server is not auto-connectable.

The millw.bat contains this part which likely causes the error:
f not exist "%MILL%" (
set VERSION_PREFIX=%MILL_VERSION:~0,4%
# Since 0.5.0
set DOWNLOAD_SUFFIX=-assembly
# Since 0.11.0
set DOWNLOAD_FROM_MAVEN=1
...

Expected behavior

Mill should be successfully installed and the scala files then builded.

Operating system

Windows

Editor/Extension

VS Code

Version of Metals

v1.3.1

Extra context or search terms

No response

Thanks for reporting! We will update to the fixed batch file.