Skip to content

LSP — Language Server Protocol #39

Description

@NightmarePog

A language server would let editors show inline errors, hover types, and eventually go-to-definition and completion for `.laz` files. The compiler already has what it needs: parser error recovery, a typechecker, and a `--check` mode that outputs JSON errors.

Planned as a separate `lazarus-lsp/` project that reuses the compiler frontend. Priority order for features:

  1. Diagnostics — inline errors on save (the `--check` mode already does the hard part)
  2. Hover types — show the inferred type of the expression under the cursor
  3. Go-to-definition — jump to where a class, method, or variable is declared
  4. Completion — members after `.`, class names in import statements
  5. Find references, rename, format, code actions — later

The main prerequisite inside the compiler is storing the inferred type back on each AST node during typecheck, so the LSP can read it without re-running the full pipeline.

Communicates over stdin/stdout with JSON-RPC 2.0, which means `std.Json` needs to land first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions