View Source cure_lsp_server (cure v0.1.0)

Cure Language Server Protocol (LSP) Implementation

This module implements the Language Server Protocol for the Cure programming language, providing IDE features like:

  • Real-time syntax checking
  • Type inference hints
  • Go-to-definition
  • Hover information
  • Code completion
  • Diagnostics reporting

LSP Protocol

The server communicates over JSON-RPC 2.0 using stdio or TCP socket.

Features

Implemented

  • initialize - Server initialization
  • textDocument/didOpen - Document opened
  • textDocument/didChange - Document changed
  • textDocument/didSave - Document saved
  • textDocument/didClose - Document closed
  • textDocument/hover - Hover information
  • textDocument/diagnostic - Real-time diagnostics

Planned

  • textDocument/completion - Code completion
  • textDocument/definition - Go to definition
  • textDocument/references - Find references
  • textDocument/rename - Symbol renaming

Summary

Functions

code_change(OldVsn, State, Extra)

get_diagnostics(Uri)

-spec get_diagnostics(binary()) -> [map()].

handle_call/3

handle_cast/2

handle_info(Info, State)

handle_message(Message)

-spec handle_message(map()) -> {ok, map()} | {error, term()}.

init(Opts)

start_link()

-spec start_link() -> {ok, pid()} | {error, term()}.

start_link(Opts)

-spec start_link(map()) -> {ok, pid()} | {error, term()}.

stop()

-spec stop() -> ok.

terminate(Reason, State)

update_document(Uri, Content)

-spec update_document(binary(), binary()) -> ok.