build-server-protocol / build-server-protocol

Protocol for IDEs and build tools to communicate about compile, run, test, debug and more.
https://build-server-protocol.github.io/
Apache License 2.0
457 stars 65 forks source link

Set up TypeScript codegen #659

Open mnoah1 opened 8 months ago

mnoah1 commented 8 months ago

Describe the use-case for this feature

There are use cases in VS Code, such as integration with the testing UI, that could be potentially best served via a direct VS Code extension instead of via LSP. Requesting to set up TypeScript code generation to make this more accessible.

(Past issue: https://github.com/build-server-protocol/build-server-protocol/issues/120)

What do you propose

Configure code generation to make bsp4ts output available for use

I've checked to make sure there isn't already a way to support this in the current protocol

Maintainer approval (This is for the maintainers)

adpi2 commented 8 months ago

There are use cases in VS Code, such as integration with the testing UI, that could be potentially best served via a direct VS Code extension instead of via LSP. Requesting to set up TypeScript code generation to make this more accessible.

@mnoah1 Are you willing to contribute?

IMO, it would make sense to develop bsp4ts now and start experimenting with it. Beware though that some parts of the protocol are not so well specified and we would like to rework them in the next major version (i.e. 3.x). Specifically, I am referring to https://github.com/build-server-protocol/build-server-protocol/discussions/652 and https://github.com/build-server-protocol/build-server-protocol/discussions/655.

mnoah1 commented 8 months ago

Yes, I'm willing to contribute

mnoah1 commented 8 months ago

I started working on this, using the ScalaRenderer as a starting point. Just making some adjustments and will put up a PR soon.

agluszak commented 8 months ago

Please be aware that there's an ongoing migration of this repo to Bazel in #615. Also please have a look at https://github.com/agluszak/bsp-generators. The bsp4kt might be a better starting point as it fully uses the new codegen.

agluszak commented 8 months ago

Have you joined our discord? If you have any questions I'll be happy to help!

mnoah1 commented 8 months ago

Ok thanks I will take a look at bsp4kt instead. Yes I recently joined the discord as well.

agluszak commented 8 months ago

There's also https://github.com/build-server-protocol/build-server-protocol/blob/master/codegen/src/main/scala/bsp/codegen/docs/TypescriptRenderer.scala

mnoah1 commented 8 months ago

I opened this pull request with what I have so far. Please let me know if you have any initial feedback: https://github.com/agluszak/bsp-generators/pull/24