Commit Graph
119 Commits
Author SHA1 Message Date
eugene yokota ae1192109d [2.0.x] ci: Scalafmt 3.11.1 (#9280)
Apply Scalafmt
2026-05-31 16:30:32 -04:00
kenji yoshida 611cea8fbd Add tailrec annotations (#8785) 2026-02-22 22:20:46 -05:00
E.G 0ec5144a63 [2.x] test: Migrate parser specs to verify.BasicTestSuite (#8551)
Migrate the following test files from ScalaTest's AnyFlatSpec to
verify.BasicTestSuite, following the pattern established by other
test files in the sbt codebase:

- SizeParserSpec.scala (util-complete)
- MultiParserSpec.scala (main-command)

Changes in all files:
- Replace AnyFlatSpec class with BasicTestSuite object
- Convert 'should ... in' syntax to 'test(...)' syntax
- Use Scala 3 syntax with colon indentation
- Add 'end' markers
- Add explicit types where needed

Related to the ongoing test migration effort.
2026-01-18 14:33:04 -05:00
xuwei-k c0fe4dfb10 Add tailrec annotation 2026-01-11 16:33:45 +09:00
Eugene Yokota 3b4547718e Remove deprecated methods 2025-05-11 05:23:41 -04:00
xuwei-k 5d660ab8b5 remove unnecessary case
- https://github.com/xuwei-k/scalafix-rules/blob/3ca36335057154ef4431fee464a86b721013d334/rules/src/main/scala/fix/RemoveParameterUntuplingCase.scala
- https://docs.scala-lang.org/scala3/reference/other-new-features/parameter-untupling.html
- https://docs.scala-lang.org/scala3/reference/other-new-features/parameter-untupling-spec.html
2025-02-22 08:48:29 +09:00
Josh Soref 613eb86447 Spelling (#8028)
* spelling: 1.x

Signed-off-by: Josh Soref <[email protected]>

* spelling: a

Signed-off-by: Josh Soref <[email protected]>

* spelling: aether

Signed-off-by: Josh Soref <[email protected]>

* spelling: anymore

Signed-off-by: Josh Soref <[email protected]>

* spelling: artifact

Signed-off-by: Josh Soref <[email protected]>

* spelling: available

Signed-off-by: Josh Soref <[email protected]>

* spelling: be

Signed-off-by: Josh Soref <[email protected]>

* spelling: bridge

Signed-off-by: Josh Soref <[email protected]>

* spelling: cannot

Signed-off-by: Josh Soref <[email protected]>

* spelling: case-insensitive

Signed-off-by: Josh Soref <[email protected]>

* spelling: checksum

Signed-off-by: Josh Soref <[email protected]>

* spelling: class loads

Signed-off-by: Josh Soref <[email protected]>

* spelling: contra

Signed-off-by: Josh Soref <[email protected]>

* spelling: dependencies

Signed-off-by: Josh Soref <[email protected]>

* spelling: dependency

Signed-off-by: Josh Soref <[email protected]>

* spelling: dependent

Signed-off-by: Josh Soref <[email protected]>

* spelling: deriveds

Signed-off-by: Josh Soref <[email protected]>

* spelling: describes

Signed-off-by: Josh Soref <[email protected]>

* spelling: early

Signed-off-by: Josh Soref <[email protected]>

* spelling: enclosed

Signed-off-by: Josh Soref <[email protected]>

* spelling: evaluation

Signed-off-by: Josh Soref <[email protected]>

* spelling: excluding

Signed-off-by: Josh Soref <[email protected]>

* spelling: execution

Signed-off-by: Josh Soref <[email protected]>

* spelling: for

Signed-off-by: Josh Soref <[email protected]>

* spelling: frequently

Signed-off-by: Josh Soref <[email protected]>

* spelling: github

Signed-off-by: Josh Soref <[email protected]>

* spelling: green

Signed-off-by: Josh Soref <[email protected]>

* spelling: https://www

Signed-off-by: Josh Soref <[email protected]>

* spelling: https

Signed-off-by: Josh Soref <[email protected]>

* spelling: in-sourcing

Signed-off-by: Josh Soref <[email protected]>

* spelling: include

Signed-off-by: Josh Soref <[email protected]>

* spelling: incompatible

Signed-off-by: Josh Soref <[email protected]>

* spelling: indefinitely

Signed-off-by: Josh Soref <[email protected]>

* spelling: information

Signed-off-by: Josh Soref <[email protected]>

* spelling: inputted

Signed-off-by: Josh Soref <[email protected]>

* spelling: just

Signed-off-by: Josh Soref <[email protected]>

* spelling: lastmodifiedtimes

Signed-off-by: Josh Soref <[email protected]>

* spelling: latest

Signed-off-by: Josh Soref <[email protected]>

* spelling: manifest

Signed-off-by: Josh Soref <[email protected]>

* spelling: miscellaneous

Signed-off-by: Josh Soref <[email protected]>

* spelling: more

Signed-off-by: Josh Soref <[email protected]>

* spelling: neither

Signed-off-by: Josh Soref <[email protected]>

* spelling: never

Signed-off-by: Josh Soref <[email protected]>

* spelling: nonexistent

Signed-off-by: Josh Soref <[email protected]>

* spelling: opted

Signed-off-by: Josh Soref <[email protected]>

* spelling: outputting

Signed-off-by: Josh Soref <[email protected]>

* spelling: params

Signed-off-by: Josh Soref <[email protected]>

* spelling: performance

Signed-off-by: Josh Soref <[email protected]>

* spelling: preceding

Signed-off-by: Josh Soref <[email protected]>

* spelling: presentation

Signed-off-by: Josh Soref <[email protected]>

* spelling: project

Signed-off-by: Josh Soref <[email protected]>

* spelling: projects

Signed-off-by: Josh Soref <[email protected]>

* spelling: protocol

Signed-off-by: Josh Soref <[email protected]>

* spelling: related

Signed-off-by: Josh Soref <[email protected]>

* spelling: representation

Signed-off-by: Josh Soref <[email protected]>

* spelling: res

Signed-off-by: Josh Soref <[email protected]>

* spelling: resolverlist

Signed-off-by: Josh Soref <[email protected]>

* spelling: resolverset

Signed-off-by: Josh Soref <[email protected]>

* spelling: response

Signed-off-by: Josh Soref <[email protected]>

* spelling: returned

Signed-off-by: Josh Soref <[email protected]>

* spelling: sbt_version

Signed-off-by: Josh Soref <[email protected]>

* spelling: scalacheck

Signed-off-by: Josh Soref <[email protected]>

* spelling: sentinels

Signed-off-by: Josh Soref <[email protected]>

* spelling: separates

Signed-off-by: Josh Soref <[email protected]>

* spelling: serves

Signed-off-by: Josh Soref <[email protected]>

* spelling: should

Signed-off-by: Josh Soref <[email protected]>

* spelling: significant

Signed-off-by: Josh Soref <[email protected]>

* spelling: specifically

Signed-off-by: Josh Soref <[email protected]>

* spelling: substitute

Signed-off-by: Josh Soref <[email protected]>

* spelling: suppress

Signed-off-by: Josh Soref <[email protected]>

* spelling: terminal

Signed-off-by: Josh Soref <[email protected]>

* spelling: the

Signed-off-by: Josh Soref <[email protected]>

* spelling: title

Signed-off-by: Josh Soref <[email protected]>

* spelling: transitive

Signed-off-by: Josh Soref <[email protected]>

* spelling: version

Signed-off-by: Josh Soref <[email protected]>

* spelling: versions

Signed-off-by: Josh Soref <[email protected]>

* spelling: want

Signed-off-by: Josh Soref <[email protected]>

* spelling: wanting

Signed-off-by: Josh Soref <[email protected]>

* spelling: whether

Signed-off-by: Josh Soref <[email protected]>

* link: sbt Cached Resolution

Signed-off-by: Josh Soref <[email protected]>

* link: Testing sbt plugins

Signed-off-by: Josh Soref <[email protected]>

---------

Signed-off-by: Josh Soref <[email protected]>
2025-02-04 01:11:28 -05:00
xuwei-k da26f3078b use withFilter instead of filter 2025-01-04 09:10:36 +09:00
eugene yokota 52d36653da Merge pull request #7997 from xuwei-k/scalafmt-convertToNewSyntax
[2.x] update `.scalafmt.conf`. enforce new scala 3 syntax
2025-01-01 22:34:03 -05:00
xuwei-k 13d6626564 update .scalafmt.conf. enforce new scala 3 syntax 2025-01-02 11:25:34 +09:00
xuwei-k a7ba960c17 use enum instead of sealed trait 2025-01-02 10:52:37 +09:00
xuwei-k d7ec1013da remove unused type params 2025-01-01 18:42:59 +09:00
eugene yokota df6e1bc2aa Merge pull request #7986 from xuwei-k/string-interpolation-format-s
[2.x] use string interpolation instead of `format` method
2025-01-01 03:03:43 -05:00
xuwei-k 13563f9d49 use string interpolation instead of format method 2025-01-01 16:02:11 +09:00
xuwei-k a444208b80 remove unnecessary asInstanceOf 2025-01-01 13:32:05 +09:00
Eugene Yokota 3d86f30837 Merge branch '1.10.x' into wip/merge-1.10.x 2024-12-16 03:20:10 -05:00
xuwei-k d193c990d1 remove implicit params. change to using 2024-11-18 06:49:22 +09:00
Friendseeker 828dc04808 Migrate all usages of System.console == null 2024-10-28 18:25:16 -07:00
Eugene Yokota 56941dac04 refactor: Update Scala 3 syntax 2024-10-27 23:55:30 -04:00
xuwei-k 22f5c798f5 use to{Int, Long, Double}Option methods 2024-10-23 12:22:40 +09:00
xuwei-k ec70bae39a use extension instead of implicit class 2024-10-23 07:05:38 +09:00
Friendseeker cdab4c10be Scalafmt 2024-10-21 21:38:59 -07:00
Friendseeker b1c4c09a7f Fix bunch more compiler errors 2024-10-21 21:38:59 -07:00
Friendseeker f87ffc8042 Fix CI compile errors 2024-10-21 21:38:59 -07:00
xuwei-k cfb9ffea95 remove deprecated [this] qualifier
https://docs.scala-lang.org/scala3/reference/dropped-features/this-qualifier.html
2024-10-03 21:16:48 +09:00
Eugene Yokota c81d269ed2 Merge branch '1.10.x' into wip/merge-1.10.x 2024-05-07 04:39:25 -04:00
Adrien Piquerez 12e9267e1e Remove more unused 2024-03-05 15:25:25 +01:00
Adrien Piquerez c15a4031a9 Fix or mute warnings 2024-03-05 10:39:00 +01:00
Adrien Piquerez e18ddb1666 Fix resolution of * on String 2024-02-07 11:47:22 +01:00
xuwei-k 6c032b8283 some trivial refactoring
- remove unused type params
- use `withFilter` if possible
- use `collectFirst` instead of `collect` and `headOption`
- use `length` instead of `size` if `Array` or `String`
- use `foreach` instead of `map`
2023-06-25 08:57:41 +09:00
Julien Richard-Foy 72bfb3f45a Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
Eugene Yokota 54c12819df Adjust to the code changes 2023-01-15 23:48:13 -05:00
Eugene Yokota 340721c4a1 KeyMacro 2023-01-15 23:43:57 -05:00
Eugene Yokota cd43045444 Port util-complete 2023-01-15 23:40:57 -05:00
Eugene Yokota 50b062b795 Port util-logging 2023-01-15 23:40:57 -05:00
Amina Adewusi ca8fd354bd Fixes parsing command args quote problem
Fixes #6802.
2022-02-04 17:52:39 +00:00
tpetillot 4f9fe2af64 fix: propagate InterruptedException from JLine.readLine
Motivation:
Cannot exit from InteractionService.readLine

Modification:
Remove try/catch of InterruptedException mapped to None in JLine.readLine
2022-01-31 21:40:32 -05:00
eugene yokota b3aae681bf Merge pull request #6711 from xuwei-k/fix-scala-2-13-warn
fix Scala 2.13 warnings
2021-11-14 21:53:57 -05:00
xuwei-k 535b15b83e fix Scala 2.13 warnings 2021-11-14 22:59:34 +09:00
xuwei-k aa8b1141f8 Update scalatest 2021-11-14 22:03:59 +09:00
Eugene Yokota 58dfca6e27 Avoid the whitespace after completion 2021-01-15 16:43:19 -05:00
Eugene Yokota 76c4ae56f0 Revert "Set complete flag in completions"
This reverts commit edf43a473b.
This fixes performance regression of tab completion observerd in https://github.com/sbt/sbt/issues/6204
2020-12-19 00:01:16 -05:00
Ethan Atkins 90ca463c70 Add signal registration in LineReader
It is possible for the signal handler to get in a state where it has no
effect in the shell. When this happens, entering ctrl+c does not exit
the shell. To ensure that ctrl+c always exits the shell, we can register
a signal handler in the line reader that write -1 to the terminal input
stream, which should cause the line reader to return an exit command.
2020-11-25 14:31:29 -08:00
xuwei-k 244784c78e load .inputrc file
I think jline2 automatically load ".inputrc" file. But jline3 changed behavior.
2020-10-14 17:13:53 +09:00
Ethan Atkins 2ccc0714e8 Make ConsoleReader creation lazy
I noticed while debugging a jline 2 issue that the SimpleReader was
creating a ConsoleReader on startup even if it was never used.
2020-09-29 10:22:28 -07:00
Ethan Atkins bb8b9a1c99 Fix switching between raw and canonical input
There were a number of issues with swithcing between raw and canonical
issues that affected both the server and the thin client. These were
reported in #5863 and #5856. In both cases, there were issues with
reading input or having the input be displayed. Debugging those issues
revealed a number of issues with how we were using the jline 3 system
terminal and the hybrid interaction with the jline 2 terminal. This
commit eliminates all of our internal jline 2 usage. The only remaining
jline 2 usage is that we create and override the global terminal for the
scala console for scala versions < 2.13. By moving away from jline 2, I
was also able to fix #5828, which reported that the home, end and delete
keys were not working.

One of the big issues that this commit addresses is that the
NetworkClient was always performing blocking reads on System.in. This
was problematic because it turns out that you can't switch between raw
and canonical modes when there is a read present. To fix this, the
server now sends a message to the client when it wants to read bytes and
only then does the client create a background thread to read a single
byte.

I also figured out how to set the terminal type properly for the thin
client on windows where we had been manually setting the capabilities to
ansi, which only worked for some keys. This fix required switching to
the WindowsInputStream that I introduced in a prior commit. Before we
were using the jline 2 wrapped input stream which was converting some
system events, like home and end, to the wrong escape sequence mappings.

The remainder of the commit is mostly just converting from jline 2 apis
to jline 3 apis.

I verified that tab completions, the scala console, the ammonite console
and a run task that read from System.in all work with both the server
and the thin client on mac, linux and windows after these changes.

Fixes #5828, #5863, #5856
2020-09-21 13:42:03 -07:00
Ethan Atkins 52743051eb Remove Terminal.withCanonicalIn
This was implemented as a no-op so we may as well get rid of it.
2020-09-21 13:42:03 -07:00
Eugene Yokota 8521be5ac8 Revert "Filter single semicolons from tab completions"
This reverts commit dcb8e18f0e.
2020-08-13 01:41:19 -04:00
Ethan Atkins adc8d5ee6e Add reprompt fast track command
With the latest sbt snapshot, the ui would get stuck if the user entered
an empty command. They would be presented with an empty prompt and could
not input any commands. This was caused by the change in
d569abe70a that reset the prompt after a
line was read. I had tried to optimize line reading by ignoring empty
commands in UITask.readline so we wouldn't have to make a new thread.
This optimization wasn't really buying much since it only affects how
quickly the user is reprompted after entering an empty command. Unless a
user is spamming the <enter> key, they shouldn't notice a difference.
2020-08-10 14:39:38 -07:00
Ethan Atkins d569abe70a Consolidate terminal prompt management
It was a bit tricky to reason about the state of the prompt for a
terminal. To help make things more clear, I reworked things so that the
LineReader always sets the prompt to Pending after it reads a command.
In MainLoop, we cache the prompt value and temporarily set it to Running
while the command is running, which is really how it should have always
been.
2020-08-09 17:18:47 -07:00