Commit Graph

24 Commits

Author SHA1 Message Date
Adrien Piquerez a76e209dde [BSP] send diagnostics when evaluating build.sbt
Since build.sbt is compiled/evaluated in `sbt.compiler.Eval`,
this commit introduces a `BuildServerEvalReporter` to redirect
the compiler errors to the BSP clients.

A new `finalReport` method is added in the new `EvalReporter` base class
to reset the old diagnostics.
2021-07-08 09:25:01 +02:00
Jason Zaugg 3d92827af3 Fix compilation error in test 2021-06-30 12:12:24 +10:00
Eugene Yokota 1c6a5d21bb Port mutable.Specification to verify.BasicTestSuite 2021-01-16 00:47:53 -05:00
Ethan Atkins b85209be78 Add sbt.Terminal trait
It can be useful for plugin and build authors to have access to some of
the virtual terminal properties. For instance, when writing a task that
needs a password, the author may wish to put the terminal in raw mode
with echo disabled. This commit introduces a new Terminal trait at the
sbt level and a corresponding task, terminal, that provides a basic
terminal api. The Terminal returned by the terminal task will correspond
to the terminal that initiated the task so that it should work with sbtn
as well as in console mode.
2020-09-27 13:33:47 -07:00
Ethan Atkins 6565618a15 Cache compiled map during build load
The continuous command recompiles the setting graph into a CompiledMap
data structure so that it can determine which files it needs to
transitively monitor during watch. Generating the CompiledMap can be
very slow for large projects (5 seconds or so on my computer in the sbt
project) and this startup cost is paid every time the user enters a
watch with `~`. To avoid this, we can cache the compile map that is
generated during the initial settings evaluation.

The only real drawback I can see is that the compiled map is guaranteed
to remain in memory so long as the BuildStructure instance that holds it
is alive. Given the performance benefit, this seems like a worthwhile
tradeoff.
2020-07-03 14:08:26 -07:00
Ethan Atkins ba345dd797 Add multi-client ui to server
This commit makes it possible for the sbt server to render the same ui
to multiple clients. The network client ui should look nearly identical
to the console ui except for the log messages about the experimental
client.

The way that it works is that it associates a ui thread with each
terminal. Whenever a command starts or completes, callbacks are invoked
on the various channels to update their ui state. For example, if there
are two clients and one of them runs compile, then the prompt is changed
from AskUser to Running for the terminal that initiated the command
while the other client remains in the AskUser state. Whenever the client
changes uses ui states, the existing thread is terminated if it is
running and a new thread is begun.

The UITask formalizes this process. It is based on the AskUser class
from older versions of sbt. In fact, there is an AskUserTask which is
very similar. It uses jline to read input from the terminal (which could
be a network terminal). When it gets a line, it submits it to the
CommandExchange and exits. Once the next command is run (which may or
may not be the command it submitted), the ui state will be reset.

The debug, info, warn and error commands should work with the multi
client ui. When run, they set the log level globally, not just for the
client that set the level.
2020-06-24 19:40:17 -07:00
Eugene Yokota f2bc786fd1 cleaning up a few compiler warnings 2018-09-17 22:30:14 -04:00
Eugene Yokota 4ff4f6e45e Update header 2018-09-14 04:53:36 -04:00
Eugene Yokota 780ca366d8 Remove warnings about configuration
Fixes #4293
Ref #4231, #4065

This fixes the regression on sbt 1.2.0 that displays a lot of warnings about configurations.

The warning was added in #4231 in an attempt to fix #4065. This actually highlights somewhat loose usage of configurations among the builds in the wild, and the limitation on the current slash syntax implementation.

I think we can remove this warning for now, and try to fix #4065 by making slash syntax more robust. In particular, we need to memorize the mapping between the configuration name and Scala identifier across the entire build, and use that in the shell.
2018-08-06 00:22:57 -04:00
Jason Pickens c9aa0c5285 Add warning for unknown project configurations. 2018-06-27 18:25:10 +12:00
Dale Wijnand 8f4b8abb7b
Run scalafmt & test:scalafmt 2018-04-24 16:12:10 +01:00
Dale Wijnand a41727fb17
Add, configure & enforce file headers 2017-10-05 09:03:40 +01:00
Eugene Yokota da046791e0 Apply Scalafmt formatting 2017-04-21 04:48:31 -04:00
Dale Wijnand e83564a6b7
Move some server pieces from main-command to main 2017-01-20 17:07:25 +00:00
Eugene Yokota b34e182d21 Bump util, lm, and zinc 2017-01-14 00:57:46 -05:00
Eugene Yokota 9ee69e5dd4 Fix test 2017-01-06 11:27:41 -05:00
Dale Wijnand 96e086b1a1 AutoPlugin should require JvmPlugin by default
Fixes #2082
2016-07-08 10:57:55 +01:00
Dale Wijnand ffafdc2e03 Remove OldPlugin 2016-06-21 08:09:30 +01:00
Eugene Yokota 0cc9488632 Bring BuildStructure and others into internal 2016-05-06 19:21:13 -04:00
Eugene Yokota fddbf77877 Fix tests 2016-04-29 02:12:35 -04:00
Eugene Yokota e57215e240 Fix test 2016-03-29 13:11:42 -04:00
Martin Duhem c981abd295 Fix all imports 2015-09-14 14:28:09 +02:00
andrzej.jozwik@gmail.com 8da8fefc68 Natural whitespace handling for SBT configuration parser AKA 'no more blankies' 2014-10-03 14:22:51 -04:00
Lukasz Piepiora 871ccb0ab9 Fixes #1416: Plugin command doesn't work
Fix `plugin` command not working with plugin names containing `.`
2014-06-29 23:55:23 +02:00