Commit Graph

1885 Commits

Author SHA1 Message Date
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
Michael Stringer a3c34c6c0a
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-09 18:01:33 +01:00
Eugene Yokota 5c394e18f6 implement window/logMessage
This sends sbt's log message as "window/logMessage" event to LSP.
2017-10-08 01:51:27 -04:00
Dale Wijnand f22843f91c
Move SlashSyntax to the settings component 2017-10-06 09:52:34 +01:00
eugene yokota 201a8031de Merge pull request #3609 from dwijnand/ref
Correct handling of resolving ThisProject
2017-10-05 15:39:24 -04:00
eugene yokota 5a6a651b8f Merge pull request #3604 from dwijnand/dedup-cmds-lists
Dedup DefaultCommands and allBasicCommands
2017-10-05 15:36:37 -04:00
Dale Wijnand f4b2fc4228
Correct handling of resolving ThisProject
In ca71b4b902 I went about fixing the
inexhaustive matching in Scope's resolveProjectBuild and
resolveProjectRef. Looking back the change was wrong.

For resolveProjectBuild the new implementation is less wrong, but still
not great, seeing as it doesn't actually do any build resolving.

For resolveProjectRef the new implementation now blows up instead of
lies. Which means it's less leneant, more "fail-fast".

isProjectThis is unused; remnant of the pre-AutoPlugin days when build
settings where defined in Plugin.settings.
2017-10-05 19:00:48 +01:00
Dale Wijnand 68129e6782
Dedup DefaultCommands and allBasicCommands
The command component's BasicCommands.allBasicCommands is a subset of
main component's BuiltinCommands.DefaultCommands, so I deduplicated.
2017-10-05 09:14:01 +01:00
Dale Wijnand a41727fb17
Add, configure & enforce file headers 2017-10-05 09:03:40 +01:00
Dale Wijnand dae4694f46 Merge pull request #3603 from eed3si9n/wip/zerozerozero
Fixes Zero / Zero / Zero / name handling
2017-10-05 08:59:30 +01:00
Eugene Yokota 60f2498c0a Implement toString for keys
toString added for REPL testing:

```
scala> Zero / Zero / Zero / name
res0: sbt.SlashSyntax.ScopeAndKey[sbt.SettingKey[String]] = Zero / Zero / Zero / name
```
2017-10-05 02:46:09 -04:00
Eugene Yokota 53bbb99617 Fixes Zero / Zero / Zero / name handling
Prior to this change `Zero / Zero / Zero / name` broke as folllows:

```
scala> Zero / Zero / Zero / name
Zero / Zero / Zero / name
<console>:18: error: inferred type arguments [sbt.Zero.type] do not conform to method /'s type parameter bounds [K <: sbt.SlashSyntax.Key[K]]
       Zero / Zero / Zero / name
                   ^
```
2017-10-05 02:43:50 -04:00
Dale Wijnand 530c405b2f
Implement Project#withId 2017-10-04 13:54:37 +01:00
Dale Wijnand d997fe8043
Oneline mkGeneratedRoot 2017-10-04 13:42:30 +01:00