satishb
(Satish)
April 12, 2019, 9:22am
1
I have been working on Swift Online Playground with Code IntelliSense,
Current Progress,
Done:
Add Monaco Editor In React App
Create a Swift Server App With WebSocket
Integrate Language Server in Monaco
Pass Events to Swift Server App Using WebSockets
Now, @blangmuir what would be the best solution for integration with SourceKit-LSP.
Is it better to add SourceKit-LSP as Library and write own JSONRPCConnection.swift ?
Here you can take look at the app and suggest what approach would be better.
Source Code: GitHub - satishbabariya/swift-online-playground: Swift Online Playground with IntelliSense
you'll get the WebSockets events over here https://github.com/satishbabariya/swift-online-playground/blob/master/Sources/Playground/routes.swift#L75
5 Likes
blangmuir
(Ben Langmuir)
April 13, 2019, 12:29am
2
Hey, looks really neat! I don't think I fully understand the architecture here - are you hoping to serve multiple connections (users? editors?) from a single sourcekit-lsp process? Could you give more details about how you want this to work?
satishb
(Satish)
April 13, 2019, 2:47am
3
The final architecture will be like this
The Front-end application will be Server side rendered (To reduce web sockets latency)
There will be multiple instances of the Back-end App with Load balances.
So we can serve many users at the same time.
Yes, there will be multiples connections, also we can't serve multiple users from a single sourcekit-lsp process? can we?
We can do something like this when WebSocket connection opens we spawn sourcekit-lsp and when socket connection closes we close sourcekit-lsp process.
satishb
(Satish)
April 19, 2019, 4:12am
4
thanks, for now i had integrated sourcekit-lsp with monaco, and now moving forward to integration inside the playground.