Commit Graph

1911 Commits

Author SHA1 Message Date
Eugene Yokota b82a1870a7 add tests around scope delegation 2018-03-10 17:24:39 -05:00
Dale Wijnand 4e038c91ce
Introduce SBT_GLOBAL_SERVER_DIR env var to override too long paths 2018-02-12 17:57:26 +00:00
Dale Wijnand 8e7dfb4b20
Handle very long socket file paths on UNIX
Fixes #3930
2018-02-08 13:00:46 +00:00
eugene yokota 4a8adbb8e0
Merge pull request #3923 from dwijnand/PluginCross-scala-versions
Upgrade Scala versions that ^^ uses
2018-02-07 22:02:10 -05:00
eugene yokota 54eb6c2d6b
Merge pull request #3929 from eed3si9n/wip/servertest2
Backport server testing as a unit test
2018-02-07 21:18:35 -05:00
Eugene Yokota 3954985506 formatting 2018-02-07 18:16:02 -05:00
Eugene Yokota 5ab122c3cf Use State to pick the port file 2018-02-07 18:00:02 -05:00
Steve Waldman 96b9429669 Rework false-defaulting 'suppressServer' to true-defaulting 'autoStartServer'. 2018-02-06 11:49:46 -08:00
Dale Wijnand 2db5c77442
Upgrade Scala versions that ^^ uses
Refs #3907
2018-02-06 16:02:45 +00:00
Steve Waldman 0aa133d276 Implement 'suppressServer' setting, for builds and plugins that prefer to be conservative about exposure to other processes. 2018-02-05 23:11:42 -08:00
eugene yokota 5d89795657
Merge pull request #3876 from eed3si9n/wip/jlineinit
Fix tab completion running `sbt console`
2018-01-22 14:14:35 -05:00
Eugene Yokota ca712acf41 Fix tab completion running `sbt console`
Fixes #3841

This fixes console task that internally uses JLine. When `console` is started from batch mode, the tab is printed as is. This is because JLine is not initialized yet.
Calling `usingTerminal` initializes and restores the terminal afterwards.
2018-01-16 15:41:48 -05:00
Dale Wijnand 0885233281
Deprecates Extracted#append for appendWithSession.
.. and appendWithoutSession.
2018-01-15 14:48:58 +00:00
Eugene Yokota 0aebb92ef5 don't block the build when server can't get up 2017-12-22 16:14:05 -05:00
Antonio Cunei 94e36a14c8 Change modifiedTime definitions 2017-12-22 01:55:37 +01:00
Antonio Cunei ebff7919e9 Revert *ModifiedTime() calls to *lastModified*() calls
There are just too many instances in which sbt's code relies on
the `lastModified`/`setLastModified` semantics, so instead of moving
to `get`/`setModifiedTime`, we use new IO calls that offer the new
timestamp precision, but retain the old semantics.
2017-12-22 01:55:37 +01:00
Eugene Yokota 13e1862c2f set jna.nosys to true programmatically
Previously I was seeing the error upon the first scripted test. I thought it was because Main was somehow not early enough. It might just be because scripted technically runs as part of the build.

Ref sbt/io#110
2017-12-21 00:08:56 -05:00
Eugene Yokota d8609ced7f formatting 2017-12-20 22:36:07 -05:00
Eugene Yokota 06ffb4f440 warn about multiple instance once
Fixes #3823

When you launch a second instance of sbt on a build, prior to this change it was displaying `java.io.IOException: sbt server is already running` on every command. This make it a bit less aggressive, and just display a warning once.

```
[warn] Is another instance of sbt is running on this build?
[warn] Running multiple instances is unsupported
```
2017-12-20 10:09:03 -05:00
eugene yokota e40ab026c0
Merge pull request #3816 from eed3si9n/wip/bump
Convert lastModified() calls to the more precise getModifiedTime() + modules bump
2017-12-16 13:19:02 -05:00
Dale Wijnand ae99922101 Use IO.getModified over importing the method 2017-12-16 12:22:42 -05:00
Antonio Cunei 8c7b781d3f Moved Milli._ to IO. 2017-12-16 12:22:42 -05:00
Antonio Cunei 699b53262a Convert lastModified() to sbt.io.Milli.getModifiedTime(), more precise 2017-12-16 12:22:42 -05:00
Dale Wijnand 8bd522511d
Make CaffeineCache a lazy val
This is to avoid it initialising Log4J2 (via SLF4J), which we initialise
ourselves programmatically in LogExchange. Also there's no need to
removeAll in initialState.

Fixes #3787
2017-12-15 08:55:55 +00:00
Dale Wijnand 2e5aabb222
Merge pull request #3805 from eed3si9n/wip/file_uri
Encode POSIX file path to URI using u3 (file:///)
2017-12-12 17:32:42 +00:00
Eugene Yokota 06b85919ba
Encode POSIX file path to URI using u3 (file:///)
Ref https://github.com/sbt/io/pull/96

Under RFC 8089, both u1 and u3 are legal, but many of the other platforms expect traditional u3.
This will increase the compatibility/usability of sbt server, for example to integrate with Vim.
2017-12-12 16:27:14 +00:00
Antonio Cunei 5c72c3b487 Revert "Alt scala parser sync workaround"
Although in theory the fix in #3776 should be preferable to
synchronize templateStats() manually, it turns out that we
still get errors in some tests. So, reverting to a
synchronized section while we investigate.

This reverts commit ee90917cc4.
2017-12-08 19:21:14 +01:00
Eugene Yokota 2b2c1f0568 prevent "shutdown" when server didn't come up 2017-12-05 08:04:59 -05:00
Eugene Yokota 93b3391167 Fixes server log hardcoded to debug level
Fixes #3786

To configure the log level of the server, this introduces a new task key named `serverLog`. The idea is to set this using `Global / serverLog / logLevel`. It will also check the global log level, and if all else fails, fallback to Warn.

```
    lazy val level: Level.Value = (s get serverLogLevel) orElse (s get logLevel) match {
      case Some(x) => x
      case None    => Level.Warn
    }
```
2017-12-02 15:20:54 -05:00
Eugene Yokota c5d578815c catch IOException intead of SocketException
`NGUnixDomainSocket` throws `java.io.IOException` instead of `SocketException`, probably because `SocketException` does not expose the contructor with a `Throwable` parameter.
To allow clients to disconnect, we need to catch `IOException`.
2017-11-29 22:42:58 -05:00
Eugene Yokota a6eb1260c8 Merge branch '1.0.x' into wip/bump 2017-11-29 16:45:02 -05:00
Eugene Yokota 6a996378c7 return Either[String, JsonRpcMessage] 2017-11-29 01:00:46 -05:00
Eugene Yokota e4dd090d0c Add debug log on unhandled notification 2017-11-29 00:51:16 -05:00
Alexey Alekhin c689821383 Added deserialization for NotificationMessage and used it in handleBody 2017-11-29 00:46:18 -05:00
Alexey Alekhin 36e079d12b Added onNotification handler for the LSP CommandChannel 2017-11-29 00:46:18 -05:00
wpopielarski 452e97e41d Adds backticks to class/trait/object name.
Adapts tests to changed specs2 dependency.

Tiny fixes.

Removes Scala IDE compiler clues.
2017-11-28 13:27:15 -05:00
wpopielarski 73b0034cfc textDocument/definition for LSP / VS Code
This is an implementation of `textDocument/definition` request.
Supports types only, and only in case when type is found in Zinc Analysis. When source(s) are found then editor opens potential source(s).
This simple implementation does not use semantic data.

During the processing of `textDocument/didSave`, we will start collecting the location of Analysis files via `lspCollectAnalyses`.
Later on, when the user asked for `textDocument/definition`, sbt server will invoke a Future call to lspDefinition, which direct reads the files to locate the definition of a class.
2017-11-28 13:27:07 -05:00
Dale Wijnand 297fd5d24b
Merge pull request #3742 from eed3si9n/wip/socket
IPC Unix domain socket / Windows named pipe
2017-11-28 16:04:11 +00:00
Dale Wijnand ee90917cc4
Alt scala parser sync workaround
Apply retronym's suggestion at https://github.com/scala/bug/issues/10605
instead of the workaround merged in https://github.com/sbt/sbt/pull/3743.
2017-11-28 12:00:38 +00:00
Eugene Yokota f785750fc4 IPC Unix domain socket for sbt server
In addition to TCP, this adds sbt server support for IPC (interprocess communication) using Unix domain socket and Windows named pipe.

The use of Unix domain socket has performance and security benefits.
2017-11-27 21:37:31 -05:00
eugene yokota e6165464ba
Merge pull request #3740 from laughedelic/wip/logmessage
LSP: improve logMessage notifications
2017-11-27 20:51:50 -05:00
xuwei-k 6b4093dc15 update specs2 4.0.1 2017-11-26 13:59:50 +09:00
xuwei-k 8ee413778a fix #3591. "Not a valid key: console-quick" 2017-11-23 14:56:52 +09:00
Dale Wijnand 8fe38d4a5a
Merge pull request #3743 from cunei/wip-flakyTests1
Workaround for scala/bug#10605
2017-11-16 10:58:53 +00:00
Antonio Cunei a050b73a46 Workaround for scala/bug#10605
templateStats() is not thread-safe in 2.12.x (at least up to 2.12.4)
2017-11-15 05:27:31 +01:00
Alexey Alekhin 0c0e0ce912 Log StringEvents and MessageEvents to the LSP client 2017-11-14 21:53:29 +01:00
Alexey Alekhin 6b6047b55c Publish ExecStatusEvent taking into account its channel name 2017-11-14 21:53:15 +01:00
OlegYch 6e29a1aa15 Improve testQuick performance, restoring caching of stamps 2017-11-07 22:56:05 -05:00
Antonio Cunei 1ca266d0f8 Do not always use Level.Debug while creating a backgroundLog
The creation of a backgroundLog was always using Debug as the
logging level for console and backing. This commit sets the
levels to those used by the caller. Fixes #3655
2017-11-06 15:33:05 +01:00
Dale Wijnand bb6d8d62ec
Merge pull request #3672 from RomanIakovlev/1.x
Add new setting to determine if running in CI env
2017-10-28 00:28:44 +01:00