@aws/lsp-partiql
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

PartiQL LSP server

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.

Updating the binary

Updating the binary requires the Docker CLI to be in your PATH

To update the binary used by the server, run npm run update-parser-binary. This will, inside a Docker container, pull the PartiQL playground repository from GitHub and run the build command to create a new binary. It is then encoded into base64 in a Typescript file and copied to the src folder. Running npm run build will then transpile the binary file to Javascript and place it in the lib folder.

Tests

Tests for this package are run using Jest, to run the tests in this package run -npm run test.

Potential improvements

This package currently has a couple of potential points-of-improvement:

  • In the bindings for the parser WASM binary, there is a code path which imports the partiql_playground_bg.wasm file. We don't use this file and code path at runtime due to the inlining of the WASM binary. When doing import checks however, Webpack fails building because it cannot find this binary. To work around this, we include a no-op file with the expected name.
  • In the tests for the language service, there are a couple of untested happy paths. Input couldn't be found to trigger these happy paths.

Readme

Keywords

none

Package Sidebar

Install

npm i @aws/lsp-partiql

Weekly Downloads

455

Version

0.0.2

License

Apache-2.0

Unpacked Size

4.76 MB

Total Files

30

Last publish

Collaborators

  • aws-language-server-runtimes-team
  • gkeller
  • saurisha
  • ege0zcan
  • rahmaniaam
  • viktorsaws
  • imykhai
  • rtarcr