aws / language-servers

AWS related Language Servers
Apache License 2.0
19 stars 18 forks source link

feat: add PartiQL language aserver #257

Closed akoreman closed 3 months ago

akoreman commented 3 months ago

Problem

Adds an LSP server for the PartiQL language. This server offers diagnostics for PartiQL files by parsing the file using the Rust parser maintained by the PartiQL team.

This parser is compiled to a WebAssembly binary using the bindings maintained by the PartiQL team in the PartiQL playground package. This binary is further encoded as a base64 string in a Javascript file to make it easy to be bundled together with the other assets of the server. See the README for instructions on how to update the binary.

Solution

Screenshot 2024-05-20 at 23 54 32

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

justinmk3 commented 3 months ago

This binary is further encoded as a base64 string in a Javascript file to make it easy to be bundled together with the other assets of the server.

Why can't it be bundled as a wasm file?

akoreman commented 3 months ago

@justinmk3 Main reason for not bundling it as a wasm file is to make it easier to use the server as a web worker when assets are loaded from a CDN. If the binary is provided as a wasm file, the worker needs to know which CDN URL to fetch the binary from. This URL needs to be communicated by the client to the web worker which adds complexity to the integration into a web app.