Commit Graph

1898 Commits

Author SHA1 Message Date
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
Roman Iakovlev 69ae4f3073 Add a check for a change in SBT version before reload
Fixes #1055
2017-10-27 20:38:23 +02:00
Roman Iakovlev 5f143434a8 Add new setting to determine if running in CI env
Fixes #3653
2017-10-26 20:59:04 +02:00
Dale Wijnand 9f1d60be60
Rewrite to polymorphic function syntax 2017-10-25 10:23:46 +01:00
eugene yokota 8eb5879101 Merge pull request #3659 from eed3si9n/wip/reboot
Adds "reboot dev"
2017-10-25 04:06:59 -04:00
Eugene Yokota 6ac4571197 Adds "reboot dev"
This adds a new option `dev` to the `reboot` command, which deletes the only the current sbt artifacts from the boot directory. `reboot dev` reads actively from `build.properties` instead of using the current state since `reboot` can restart into another sbt version.

In general, `reboot dev` is intended for the local development of sbt.

Fixes #3590
2017-10-25 03:19:10 -04:00
Dale Wijnand 81c5eaec33 Merge pull request #3633 from dwijnand/misc-2017-10-12
Misc 2017-10-12
2017-10-24 20:37:20 +01:00
Dale Wijnand 78c5ee92d3
Track sources in base directory non-recursively
Using a recursive Source meant that ~ looked into target. If you have
any source generators and use ~ with anything the invokes them, like
~compile, that means that the act of generating sources triggers ~ to
re-execute compile (perhaps only on macOS where the NIO WatchService
just polls, after an initial delay).

Requires sbt/io#78

Fixes #3501
2017-10-24 11:09:00 +01:00
PanAeon 64241e0d3a Fixes #3464. Escape imports from sbt files, so if user creates a backquoted definition then task evalution will not fail. 2017-10-13 11:04:15 +01:00
Dale Wijnand 10397926aa
Make sure of EvaluateTask in Extracted obvious 2017-10-12 15:36:05 +01:00
eugene yokota fa33b6e422 Merge pull request #3632 from dwijnand/trailing-println
Kill trailing println
2017-10-11 13:38:09 -04:00
Dale Wijnand d8e52bb5d4
Kill trailing println 2017-10-11 15:29:15 +01:00
eugene yokota 8c04b267bf Merge branch '1.x' into 1.0.x 2017-10-10 10:57:05 -04:00
Michael Stringer b9a4d32916 Add system property to revert to old polling fs watcher
This adds a sbt.watch.mode system property that if set to 'polling' will
use PollingWatchService instead of WatchServiceAdapter (nio).

On macOS this will default to 'polling' and on all others 'nio'.

This is a temporary workaround for users affected by #3527
2017-10-10 01:17:42 -04:00