Skip to content

Commit 0a687c0

Browse files
Merge pull request #94 from alexarchambault/develop
Tweak completions, default Bloop timeouts, updates
2 parents 1167e82 + 84a847e commit 0a687c0

File tree

8 files changed

+45
-22
lines changed

8 files changed

+45
-22
lines changed

build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import $ivy.`com.lihaoyi::mill-contrib-bloop:$MILL_VERSION`
22
import $ivy.`io.get-coursier::coursier-launcher:2.0.16+73-gddc6d9cc9`
3-
import $ivy.`io.github.alexarchambault.mill::mill-native-image-upload:0.1.8`
3+
import $ivy.`io.github.alexarchambault.mill::mill-native-image-upload:0.1.9`
44
import $file.project.deps, deps.{Deps, Docker, Scala}
55
import $file.project.publish, publish.{ghOrg, ghName, ScalaCliPublishModule}
66
import $file.project.settings, settings.{CliLaunchers, FormatNativeImageConf, HasMacroAnnotations, HasTests, LocalRepo, PublishLocalNoFluff, localRepoResourcePath, platformExecutableJarExtension}

modules/bloop-rifle/src/main/scala/scala/build/blooprifle/BloopRifleConfig.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ object BloopRifleConfig {
9191
bspStdout = None,
9292
bspStderr = None,
9393
period = 100.milliseconds,
94-
timeout = 5.seconds,
95-
initTimeout = 10.seconds
94+
timeout = 10.seconds,
95+
initTimeout = 30.seconds
9696
)
9797

9898
}

modules/build/src/main/scala/scala/build/Sources.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ object Sources {
8989
// replace statements like
9090
// import $ivy.`foo`,
9191
// by
92-
// import $ivy.$ ,
92+
// import $ivy.A ,
9393
// Ideally, we should just wipe those statements, and take care of keeping 'import' and ','
9494
// for standard imports.
9595
val buf = content.toCharArray

modules/cli-core/src/main/scala/scala/cli/commands/InstallCompletions.scala

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,28 @@ object InstallCompletions extends ScalaCommand[InstallCompletionsOptions] {
7373
sys.exit(1)
7474
}
7575

76-
val rcFile = options.rcFile
77-
.map(os.Path(_, os.pwd))
78-
.getOrElse(defaultRcFile)
76+
if (options.env) {
77+
println(rcScript)
78+
} else {
7979

80-
val banner = options.banner.replace("{NAME}", name)
80+
val rcFile = options.rcFile
81+
.map(os.Path(_, os.pwd))
82+
.getOrElse(defaultRcFile)
83+
84+
val banner = options.banner.replace("{NAME}", name)
8185

82-
val updated = ProfileFileUpdater.addToProfileFile(rcFile.toNIO, banner, rcScript, Charset.defaultCharset())
86+
val updated = ProfileFileUpdater.addToProfileFile(rcFile.toNIO, banner, rcScript, Charset.defaultCharset())
8387

84-
if (options.logging.verbosity >= 0) {
85-
if (updated) {
86-
System.err.println(s"Updated $rcFile")
87-
System.err.println(
88-
s"It is recommended to reload your shell, or source $rcFile in the " +
89-
"current session, for its changes to be taken into account."
90-
)
91-
} else
92-
System.err.println(s"$rcFile already up-to-date")
88+
if (options.logging.verbosity >= 0) {
89+
if (updated) {
90+
System.err.println(s"Updated $rcFile")
91+
System.err.println(
92+
s"It is recommended to reload your shell, or source $rcFile in the " +
93+
"current session, for its changes to be taken into account."
94+
)
95+
} else
96+
System.err.println(s"$rcFile already up-to-date")
97+
}
9398
}
9499
}
95100
}

modules/cli-core/src/main/scala/scala/cli/commands/InstallCompletionsOptions.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ final case class InstallCompletionsOptions(
1414
rcFile: Option[String] = None,
1515
directory: Option[String] = None,
1616
banner: String = "{NAME} completions",
17-
name: Option[String] = None
17+
name: Option[String] = None,
18+
env: Boolean = false
1819
)

project/settings.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import $ivy.`io.github.alexarchambault.mill::mill-native-image_mill0.9:0.1.8`
1+
import $ivy.`io.github.alexarchambault.mill::mill-native-image_mill0.9:0.1.9`
22
import $file.deps, deps.{Deps, Docker}
33

44
import io.github.alexarchambault.millnativeimage.NativeImage

website/docs/installation.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,21 @@ Once downloaded, right-click on `scala-cli-x86_64-apple-darwin.pkg` from Finder,
102102

103103
## Shell completions
104104

105-
### bash
105+
Only bash and zsh completions are offered for now.
106106

107-
### zsh
107+
Try the completions with
108+
```text
109+
$ eval "$(scala-cli install completions --env)"
110+
$ scala-cli --<TAB>
111+
```
112+
113+
Install them on your system with
114+
```text
115+
$ scala-cli install completions
116+
```
117+
118+
If any of the `scala-cli install completions` command complained that your shell cannot be determined, specify it
119+
with `--shell`, like
120+
```text
121+
$ scala-cli install completions --shell zsh
122+
```

website/docs/reference/cli-options.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ Aliases: `--shell`
173173

174174
#### `--name`
175175

176+
#### `--env`
177+
176178
## Java options
177179

178180
Available in commands:

0 commit comments

Comments
 (0)