Commit Graph

87 Commits

Author SHA1 Message Date
xuwei-k 70960744e7 Scala 2.12.21 2025-12-09 17:28:03 +09:00
Eugene Yokota 5d5fe21ec5 Revert run switching on 1.x
**Problem**
client-side run apparently won't work for Scala.JS,
so forcing sbtn users to client-side run will break the Scala.JS users.

**Solution**
This reverts the client-side run on sbt 1.x, while retaining the
mechanism for sbt 2.x usages via sbtn.
Now, if `run / connectInput := true` is true, stdout will not display on sbtn.
2025-03-03 04:59:36 -05:00
Eugene Yokota a18ed19cbc fix: Use JDK path, not JRE path
**Problem**
There are a few places where javaHome or java path is set,
using java.home system property. The problem is that it points to JRE,
not JDK, so it would break on Java compilation etc.

**Solution**
If the path ends with jre, go up one directory.
2025-03-03 02:31:44 -05:00
Eugene Yokota 67265638c6 Implement client-side run
**Problem**
`run` task blocks the server, but during the run the server is just
waiting for the built program to finish.

**Solution**
This implements client-side run where the server creates a sandbox
environment, and sends the information to the client,
and the client forks a new JVM to perform the run.
2025-03-02 20:45:04 -05:00
Friendseeker 655310061f Add unit test 2024-12-26 14:56:18 -08:00
Seth Tisue f06b7622be Scala 2.12.20 (was .19) 2024-10-10 12:53:31 -07:00
adpi2 03d5bf6e55
Fix BuildServerTest 2024-09-03 10:09:07 +02:00
SlowBrainDude f6663a0d6c Fix stale BSP diagnostics
The BSP server didn't reset old diagnostic messages sent to BSP clients under
certain circumstances. This commit mitigates this edge case and ensures that
diagnostics for files that previously had compilation problems are properly
reset when fresh diagnostics messages are sent.

The culprit was a mismatch of map keys: Files with problems were sometimes recorded
under an absolute path, but later attempted to be retrieved by virtual path.
2024-09-02 15:27:26 +02:00
Adrien Piquerez f990bd2d8d [BSP] Fix importing Optional project dependency 2024-05-21 15:56:37 +02:00
Seth Tisue 735214afd0 Scala 2.12.19 (was 2.12.18), scala-xml 2.2.0 (was 2.1.0) 2024-03-16 11:39:55 +01:00
Adrien Piquerez 02df82840a add noOp field in BSP compile report 2024-02-15 15:50:02 +01:00
Adrien Piquerez a4097440bf Build server test refactoring 2023-10-25 15:01:08 +02:00
Adrien Piquerez b189d49968 Refactoring 2023-10-25 14:19:03 +02:00
unknown 3d1319efea Use sourcePositionMappers in BuildServerReporter 2023-10-25 11:40:18 +02:00
Adrien Piquerez 667e4b67cd Fix initialize test 2023-08-22 10:06:26 +02:00
Adrien Piquerez 5515619ecc Implement buildTarget/javacOptions 2023-08-10 16:11:28 +02:00
xuwei-k 2edb4dcbb6 fix typo 2023-06-24 20:05:52 +09:00
Matthias Kurz ebbf0617a2
Update Scala to 2.13.11 2023-06-03 22:27:45 +02:00
Eugene Yokota 10a79bc6b0 Update Scala to 2.13.10 2023-06-01 23:24:31 -04:00
Eugene Yokota 1f1ee778e3 Update Scala to 2.12.18
Fixes https://github.com/sbt/sbt/issues/7235
2023-06-01 12:13:40 -04:00
Adrien Piquerez ecc4469c3e Test diagnostics from Java 2023-01-27 12:10:32 +01:00
Adrien Piquerez 799adcda2b Some refacto of BuildServerTest
Generate BSP ids automatically
2023-01-27 10:22:23 +01:00
Eugene Yokota b00792a3a7 Scala 2.12.17
This bumps up scala-xml to 2.x.
2022-09-17 04:09:52 -04:00
Krzysztof Pado 2bffb2731e Add support for BSP's buildTarget/outputPaths method 2022-08-03 10:13:48 +02:00
Kamil Podsiadlo 7921cab7e3 fix: publishing bsp diagnostics
* do not publish bsp diagnostics if there were and there are no problems
* publish diagnostics if problems needs to be updated
2022-06-25 11:14:51 +02:00
Eugene Yokota d5889d3ce3 Bump to Scala 2.12.16 2022-06-13 01:27:24 -04:00
Kamil Podsiadlo f16412c3dd tests: run&test environment requests 2022-04-12 20:09:39 +02:00
Rikito Taniguchi f5e9ab8424 Add test to verify server doesn't send notifications 2022-03-27 00:12:30 -04:00
Kamil Podsiadlo ce978a19ed tests: add test case for framework field in scala test classes request 2022-03-10 19:56:49 +01:00
Eugene Yokota 6c68b843d5 Fixes tab completion of global keys
Fixes #1373
Fixes #6715

Following my own PR #2855 around `ThisBuild`, this attempts to fix the
tab completion of globally scoped keys from the shell.
2021-11-16 19:23:25 -05:00
Adrien Piquerez 75d3bf2b5f [BSP] remove duplicated sources in sbt build target
Also remove the base directory (`./project/`) from the list of source directories
2021-10-29 15:40:00 +02:00
Adrien Piquerez e64c71dd58 [BSP] Support base source files 2021-10-29 15:40:00 +02:00
Eugene Yokota 0413727796 Drop TrapExit
Fixes https://github.com/sbt/sbt/issues/6558

Problem
-------
sbt uses SecurityManager feature of JDK to trap `sys.exit` call during
`run`-like tasks, since we emulate `run` and `console` as function calls.
JDK 17 deprecated SecurityManager and it's printing warnings.

Solution
--------
About 10 years go, `exit` was a convenient way of quitting both Scala
REPL and sbt shell. Scala 2.11 broke this by removing the `Predef.exit`.
We still need to worry about `run` potentially calling `sys.exit`
but that can be handled using fork feature.
In the long-run, it probably is better to be JDK 17 compatible.
2021-09-19 12:47:59 -04:00
Eugene Yokota 6564090976 Increase timeout for progress test 2021-09-18 18:45:37 -04:00
Eugene Yokota 8b9cbb3311 Follow up on Scala 2.12.15 bump 2021-09-18 18:08:26 -04:00
Igal Tabachnik 9986fb6eed Adding a test verifying task progress reports (task start/progress/finish) 2021-09-10 13:06:03 +03:00
Igal Tabachnik 20fcab4651 Ensuring both "Rebuild Project" and "Rebuild module" work from IntelliJ 2021-08-28 13:50:12 +03:00
Igal Tabachnik a920693c96 Checking for target .class files present and absent before and after cleanCache 2021-08-27 17:46:41 +03:00
Igal Tabachnik c55880d795 Implementing `buildTarget/cleanCache` to support Rebuild operations from IntelliJ 2021-08-27 17:46:41 +03:00
Adrien Piquerez 120ccccaab Make BSP requests robust to some target failures
The request of the form buildTarget/* often take a sequence of build
targets as parameter. So far if there is an error on a single build
target, the entire request fails.
This is not the best because the client wants the result of the other
build targets anyway:
For example:
- workspace/buildTargets: if one build target has an invalid Scala
version we still want to import the other ones
- buildTarget/scalacOptions: if a dependency cannot be resolved we still
want to import the build targets that do not depend on it
- buildTarget/scalaMainClasses: if buildTarget does not compile we still
want the main classes of the other targets
...

The change is to respond to BSP requests with the successful
build targets and  to ignore the failed ones.
This is implemented the same in Bloop since before BSP in sbt.

In  https://github.com/build-server-protocol/build-server-protocol/issues/204,
I made a proposal to also add the failed build targets in the response.
2021-07-30 14:41:00 +02:00
Adrien Piquerez b4c6299b9c [BSP] Add test on failing workspace/reload 2021-07-08 09:25:01 +02:00
Jason Zaugg fe046476b1 Refine and test SBT BSP target
- Pass source dirs and current list of files
  - Align display name and URI
2021-06-30 11:19:24 +10:00
Adrien Piquerez ef7d8b68f6 [BSP] add server test on custom failure when compiling 2021-06-25 10:41:10 +02:00
Samuel CLARENC f3ec202a06 Add resourcesProvider flag to BuildServerCapabilities in BSP contra 2021-06-21 16:51:34 +02:00
Samuel CLARENC a0e3d89855 Implement BSP buildTarget/resources command 2021-06-21 16:51:34 +02:00
Matthias Kurz fbfc272171
Scala 2.12.14 / 2.13.6 2021-05-28 18:13:28 +02:00
Adrien Piquerez 93afa7e892 Improve BSP processing logs
The processing log is sent when a command issued by a request is being
processed, if the request has not yet been responded. In particular,
the processing log of sbtReportResult is filtered out if the client has
already received a response.

The processing log severity is the lowest so that it can be ignored by
the BSP client.
2021-03-09 10:18:12 +01:00
Eugene Yokota 68bd693178 ResponseTest 2021-02-06 23:24:09 -05:00
Ethan Atkins 7e1384608e Fix console when supershell is disabled
The sbt console didn't work with supershell disabled because setting
that parameter was causing the terminal type to be dumb which only works
in some very specific situations. When Terminal.isAnsiSupported was
false, we were setting sbt to use a dumb terminal. We really only want
to use a dumb terminal if virtual io is off. It also doesn't necessarily
make sense to automatically disable general ansi codes even if
supershell is disabled by system property.
2020-11-04 18:47:01 -08:00
Adrien Piquerez 66f4032699 Fix BuildServerReporter and add tests 2020-10-26 09:04:14 +01:00