Commit Graph

135 Commits

Author SHA1 Message Date
Ethan Atkins 41d66abb02 Add support for JNI implementation of ClientSocket
The JNI implementation is needed in order for a graalvm native-image to
be build of the NetworkClient.
2020-06-24 19:19:06 -07:00
Ethan Atkins af5afef271 Add option to skip collectAnalysis on network init
The collectAnalysis task an be a bit slow and delays client connections
from running commands. This commit adds an option to skip the analysis
if it isn't needed. The default behavior is left as it was.
2020-06-24 19:19:06 -07:00
adpi2 159171bba5 Add suggestion about semanticdb when Metals connect to sbt
Try parse the required semanticdbVersion in the initialization request metadata
Issue a warning if the semanticdb plugin is not enabled
Issue a warning if the semanticdb version is lower than the required
2020-06-15 16:57:49 +02:00
eugene yokota 2b557851ca
Merge pull request #5041 from jsoref/https
Https
2020-06-14 17:34:58 -04:00
Eugene Yokota d599ae2c16 Deprecate unused methods 2020-06-12 16:34:37 -04:00
Eugene Yokota 033ff1d8a5 Make JSON parsing errors more consistent 2020-06-11 20:31:13 -04:00
adpi2 eac9328db7 Replace -jar with -classpath in BuildServerConnectionDetails 2020-06-08 15:36:41 +02:00
Adrien Piquerez 0789fd7be6 Use java command in BspConnectionDetails 2020-05-25 13:32:48 +02:00
Adrien Piquerez b184be860f Add headers 2020-05-25 10:43:54 +02:00
Adrien Piquerez c11ee3269c Add BspCompilationTaskProgress 2020-05-22 11:15:47 +02:00
Adrien Piquerez a31747758c Create BSP connection file at server startup 2020-05-18 09:35:14 +02:00
Adrien Piquerez 24f6a6f290 add BSP buildTarget/dependencySources 2020-05-16 09:52:21 +02:00
Adrien Piquerez 068fe2ad0a add BuildServerCapabilities 2020-05-16 09:52:21 +02:00
Adrien Piquerez 3ae42ae9c6 fix scala jars and add capabilities in BuildTarget 2020-05-16 09:52:21 +02:00
Adrien Piquerez a415cd0cfc replace LSP compiler reporter by BSP one 2020-05-16 09:52:20 +02:00
Adrien Piquerez f89cef1fd0 add bspCompile task 2020-05-16 09:52:20 +02:00
Adrien Piquerez 994e05ef12 Remove obsolete codec formats 2020-05-16 09:52:20 +02:00
Eugene Yokota d2d0a9ca80 buildTarget/scalacOptions 2020-05-16 09:52:20 +02:00
Eugene Yokota 1ccff0ca6d Add Scala Build Target 2020-05-16 09:52:20 +02:00
Eugene Yokota cb93d20492 build server protocol
Initial draft for bsp support.

This shows two communication pattern around BSP.
First, if the request can be handled with the build knowledge is readily available in `NetworkChannel` we can reply immediately. `BuildServerImpl#onBspBuildTargets` is an example for that.

Second, if the request requires `State`, then we can forward the parameter into a custom command, and reply back from a command. `BuildServerProtocol.bspBuildTargetSources` is an example of that since it needs to invoke tasks to generate sources.
2020-05-16 09:52:20 +02:00
Adrien Piquerez 781584d137 id is mandatory in json rpc responses 2020-05-11 16:51:34 +02:00
Eugene Yokota 2396b449fe Contraband 0.4.6 2020-04-24 17:44:15 -04:00
Eugene Yokota 25a79d0ac6 Add State extension
Fixes https://github.com/sbt/sbt/issues/3112

This unpacks Extracted as State's extension methods.

In addition this provides a way of responding via LSP.
2020-02-15 19:32:19 -05:00
Ethan Atkins aecdc44909 Update contraband sources
In 8bfae66b9d I upgraded contraband but
not all of the sources were regenerated because I didn't run clean
before recompiling.
2019-12-12 11:34:53 -08:00
Ethan Atkins 094d730b06 Bump scalafmt 2019-11-30 14:57:20 -08:00
Eugene Yokota 54b3405f42 apply -Yno-lub
To demonstrate [-Yno-lub](http://eed3si9n.com/stricter-scala-with-ynolub), this shows the code changes that removes lubing (Not all subprojects are done).

After I made the changes, I switched the Scala back to normal 2.12.10.
2019-10-13 23:46:23 -04:00
Josh Soref c9d5cbe808 https://www.scala-sbt.org 2019-09-05 14:11:13 -04:00
Josh Soref 5579727148 https://www.jsonrpc.org 2019-09-05 14:11:09 -04:00
Eugene Yokota 1e157b991a apply formatting 2019-04-20 03:23:54 -04:00
andrea 34e0fc159c [sbt-server] LSP completions support 2018-10-11 13:34:40 +01:00
andrea d7c55a3d82 Implementing cancellation requests for LSP server 2018-10-01 14:39:26 +01:00
Eugene Yokota 4b23036c63 contraband 0.4.1 2018-09-18 16:56:19 -04:00
Eugene Yokota 4ff4f6e45e Update header 2018-09-14 04:53:36 -04:00
Eugene Yokota 18c6b04b47 Fix thin client to use LSP
Fixes https://github.com/sbt/sbt/issues/2798
2018-06-25 22:26:13 -04:00
Dale Wijnand 8f4b8abb7b
Run scalafmt & test:scalafmt 2018-04-24 16:12:10 +01:00
Eugene Yokota c2837c7714 Merge branch 'wip/bumpsbt' into wip/merge-1.1.x 2018-03-27 10:16:10 -04:00
tiqwab a5119a411c Fix handling id in jsonrpc model
Fix #3861
2018-03-17 22:41:47 +09:00
Dale Wijnand 5f56fa9f14
Extract serializeResponse 2018-03-15 12:55:21 +00:00
Dale Wijnand de690f4e41
Collapse 1-line scaladocs 2018-03-15 12:55:20 +00:00
Dale Wijnand bde6365013
Add an optional exitCode to ExecStatusEvent so clients can use it 2018-03-14 11:56:51 +00:00
Dale Wijnand 7baf97d2a6
Introduce ErrorCodes.UnknownError
Defined in the application defined errors range.
2018-03-14 11:56:51 +00:00
Dale Wijnand 3530349e9a
Rename ErrorCodes' UnknownErrorCode to UnknownServerError
Allows for a non-server-specific unknown error code to be defined.
2018-03-14 11:56:50 +00:00
Dale Wijnand 8972287892
Cleanup ErrorCodes 2018-03-14 11:56:29 +00:00
Dale Wijnand dd4de14593
Upgrade to contraband 0.4.0 2018-03-12 15:39:07 +00:00
Dale Wijnand ed5a8c118b
Upgrade to contraband 0.3.3 2018-03-08 12:49:38 +00:00
Eugene Yokota bd0e44c292 start an instance of sbt in the background 2018-02-07 17:49:22 -05:00
Eugene Yokota 1f9a8bf310 start an instance of sbt in the background 2018-01-30 23:46:12 -05:00
Dale Wijnand 113656aed1
Remove compile warnings 2018-01-16 11:17:01 +00:00
Dale Wijnand 6e09c660fe
Replace Throwable catching with DeserializationException catching 2017-12-20 11:50:02 +00:00
Eugene Yokota 40b86ae412 bump modules and plugins 2017-12-16 12:22:42 -05:00
Eugene Yokota 6a996378c7 return Either[String, JsonRpcMessage] 2017-11-29 01:00:46 -05:00
Alexey Alekhin c689821383 Added deserialization for NotificationMessage and used it in handleBody 2017-11-29 00:46:18 -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
eugene yokota e6165464ba
Merge pull request #3740 from laughedelic/wip/logmessage
LSP: improve logMessage notifications
2017-11-27 20:51:50 -05:00
Martin Duhem 238540d34a
Remove 2 useless files in protocol
They have been moved to Contraband since, but never removed.
2017-11-21 10:46:57 +01:00
Alexey Alekhin 8fe1934ea0 Tweaked MessageType.fromLevelString conversion 2017-11-14 21:53:57 +01:00
Simon Schäfer 0454b873bf Fix warnings in protocol project
There were warnings about catch all exception handlers.
2017-10-19 13:07:24 +02: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 a41727fb17
Add, configure & enforce file headers 2017-10-05 09:03:40 +01:00
Eugene Yokota a8e770c446 handle exec as "sbt/exec" 2017-10-03 00:18:58 -04:00
Eugene Yokota 0c1c380f71 begins language server protocol
This is the first cut for the Language Server Protocol on top of server that is still work in progress.

With this change, sbt is able to invoke `compile` task on saving files in VS Code.
2017-10-02 04:01:13 -04:00
Eugene Yokota d5e24979bf Reference token file using URI and full file path
Node didn't seem to like read URI out of the box, and I am not sure if File -> URI -> File conversion is universally accepted.

Ref sbt/sbt#3088
2017-09-25 01:35:49 -04:00
Eugene Yokota 348a077797 implement tokenfile authentication 2017-09-21 23:05:48 -04:00
Eugene Yokota 8a8215cf1b Use uri instead of url 2017-09-18 23:07:29 -04:00
Eugene Yokota 9d40404915 JSON port file
This implements JSON-based port file. Thoughout the lifetime of the sbt server there will be `cwd / "project" / "target" / "active.json"`, which contains `url` field.

Using this `url` the potential client, such as IDEs can find out which port number to hit.

Ref #3508
2017-09-17 19:19:56 -04:00
Eugene Yokota 00a9dd14a4 Bump Contraband to latest 2017-07-17 01:05:30 -04:00
Eugene Yokota f0ac6ae11c Adjust to upstream changes 2017-07-16 00:51:49 -04:00
Eugene Yokota efa3b1d340
Bump to latest io, scalajson, sjsonnew, contraband, util, lm, zinc 2017-07-06 11:05:24 +01:00
Eugene Yokota da046791e0 Apply Scalafmt formatting 2017-04-21 04:48:31 -04:00
Eugene Yokota 622ebfd000 Switch to using util's JValueFormats 2017-04-03 03:41:45 -04:00
Dale Wijnand 70ac55d0b4
Encode success/failure in setting query response 2017-03-27 14:15:10 +01:00
Dale Wijnand 875cf6f4dc
Simplify JValueFormat 2017-03-27 12:29:42 +01:00
Dale Wijnand 43eec230e6
Switch SettingQueryResponse to JValue, implement JValueFormat 2017-03-27 12:29:41 +01:00
Eugene Yokota b6d8b565de Codegen change 2017-03-23 14:30:51 -04:00
Eugene Yokota 180bdfd129 Bump underlying modules to latest 2017-03-23 12:41:24 -04:00
Dale Wijnand f09897ca29
Drop aggregation in querying settings 2017-03-05 13:42:14 +00:00
Dale Wijnand d9d741851a
Add and handle GetSetting 2017-03-05 13:42:11 +00:00
Dale Wijnand 4b88378c61
Delete stale contraband classes
This is due to sbt/contraband#75.
2017-03-05 13:40:11 +00:00
Eugene Yokota 8c9dfda089 Split log output per channel
LogManager implementation is modified to use ManagedLogger, which can swap out backing Appenders without re-creating the log instance.

The State was also changed to track `currentCommand: Option[Exec]`. `Exec` knows the origin of the command invocation, and using that we can now send the network-originated events only to the network clients.

Combined together, this implements log splitting between the sbt clients (channels).
2017-01-13 03:00:02 -05:00
Eugene Yokota 66301dbaf1 Adjust from rebasing 2017-01-06 11:35:08 -05:00
Eugene Yokota 892e25d23f Introduce execId that gets sent back
Now the client can put an id on each exec.
This can then be tracked and/or be used to block the user input.
2017-01-06 11:27:41 -05:00
Eugene Yokota 1bf50e10c8 Use Exec in State 2017-01-06 11:27:41 -05:00
Eugene Yokota d96ef58605 Unifying towards using events 2017-01-06 11:27:06 -05:00
Eugene Yokota fa7253ece3 Start lightweight client
This is the beginning of a lightweight client, which talks to the
server over Contraband-generated JSON API. Given that the server is
started on port 5173:

```
$ cd /tmp/bogus
$ sbt client localhost:5173
> compile
StatusEvent(Processing, Vector(compile, server))
StatusEvent(Ready, Vector())
StatusEvent(Processing, Vector(, server))
StatusEvent(Ready, Vector())
```
2017-01-06 11:27:06 -05:00
Eugene Yokota 272e733b87 Update to Contraband 2017-01-06 11:27:06 -05:00