Skip to content

Package

The Pony Language Server

This package implements the (Language Server Protocol Spec v3.17](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/) for Pony.

It is using the ast library to parse and type-check pony projects opened in the editor, using the same code as the official compiler ponyc, so the diagnostics and code analysis provided will always be in sync with what the ponyc compiler provides.

Package Contents

lsp

This package contains all the code supporting the protocol, data structures and types from the spec, the communication with a language client. The LanguageServer is controlling which requests and notifications are supported and dispatches to the actor handling the workspace for the given request.

  • Channel defining the necessary channel behaviours and Stdio being the implementation for Standard-IO based communication.
  • PonyCompiler as an actor whose main job is to expose the ast lib functionality of parsing and typechecking a pony project and to linearize all requests as the underlying libponyc is not 100% thread-safe.

lsp/workspace

This package contains the actual logic applied to handling a single pony project. The WorkspaceManager actor handles requests and notifications, starts the parsing and typechecking process and receives its results. It builds up the necessary state needed for answering LSP client requests in the PackageState and DocumentState classes.

Public Types