New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make sbt server extensible #3975

Merged
merged 3 commits into from Mar 15, 2018

Conversation

Projects
None yet
5 participants
@eed3si9n
Member

eed3si9n commented Feb 28, 2018

Fixes #3890

Here's an example:

    Global / serverHandlers += ServerHandler({ callback =>
      import callback._
      import sjsonnew.BasicJsonProtocol._
      import sbt.internal.protocol.JsonRpcRequestMessage
      ServerIntent(
        {
          case r: JsonRpcRequestMessage if r.method == "lunar/helo" =>
            jsonRpcNotify("lunar/oleh", "")
            ()
        },
        PartialFunction.empty
      )

@eed3si9n eed3si9n requested a review from dwijnand Mar 1, 2018

@dwijnand

1 request, 1 question

rest LGTM

*/
package sbt

This comment has been minimized.

@dwijnand

dwijnand Mar 9, 2018

Member

could you make these sbt.internal.server please so we can break their API, please?

This comment has been minimized.

@eed3si9n

eed3si9n Mar 9, 2018

Member

If we are exposing this out to plugins, then it needs to be public, no?
Are we saying that people can extend it, but the extension is not guaranteed to work down the line?

This comment has been minimized.

@dwijnand

dwijnand Mar 12, 2018

Member

yes, it's exposed with 0 compatibility promises. caveat emptor

This comment has been minimized.

@laughedelic

laughedelic Mar 12, 2018

Member

I think it's fine if it's presented as an experimental/beta functionality.

lazy val fallback: ServerHandler = ServerHandler({ handler =>
ServerIntent(
{ case x => handler.log.debug(s"Unhandled notification received: ${x.method}") },
{ case x => handler.log.debug(s"Unhandled request received: ${x.method}") }

This comment has been minimized.

@dwijnand

dwijnand Mar 9, 2018

Member

any particular reason not to print the whole object like before?

eed3si9n added some commits Feb 28, 2018

make sbt server extensible
Fixes #3890

Here's an example:

```scala
    Global / serverHandlers += ServerHandler({ callback =>
      import callback._
      import sjsonnew.BasicJsonProtocol._
      import sbt.internal.protocol.JsonRpcRequestMessage
      ServerIntent(
        {
          case r: JsonRpcRequestMessage if r.method == "lunar/helo" =>
            jsonRpcNotify("lunar/oleh", "")
            ()
        },
        PartialFunction.empty
      )
```

@dwijnand dwijnand added this to the 1.2.0 milestone Mar 15, 2018

@dwijnand dwijnand merged commit 087f217 into sbt:1.x Mar 15, 2018

3 checks passed

Codacy/PR Quality Review Good work! A positive pull request.
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@dwijnand dwijnand removed the in progress label Mar 15, 2018

@eed3si9n eed3si9n deleted the eed3si9n:wip/serverext branch Mar 15, 2018

@eed3si9n

This comment has been minimized.

Member

eed3si9n commented Mar 15, 2018

woohoo!

@dwijnand

This comment has been minimized.

Member

dwijnand commented Mar 15, 2018

sorry I only realised during the sbt meeting that you'd pushed the last commit 2 days ago.. :-/

@olafurpg

Woot, looking forward to give this a spin! Thanks 😄

@jvican

This comment has been minimized.

Member

jvican commented Mar 15, 2018

This is a good first step to have bsp support in sbt, thanks for doing it. 👍

@jvican

This comment has been minimized.

Member

jvican commented May 30, 2018

Hasn't this been released in an sbt version? This is blocking me from implementing a bsp prototype in sbt.

@jvican

This comment has been minimized.

Member

jvican commented May 30, 2018

@eed3si9n Would be really helpful if we can get this in a release soon so that I can work on the bsp prototype plugin ^^

@eed3si9n

This comment has been minimized.

Member

eed3si9n commented Jun 5, 2018

Yea. We'll try to get some 1.2.0 milestone out soonish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment