Skip to main content

Module lsp_parser

Module lsp_parser 

Source
Expand description

Token resolution and Markdown-highlighted type display for LSP hover.

Given the full source text and a cursor position (line, character), this module:

  1. Identifies the word (identifier / literal) under the cursor.
  2. Parses and type-checks the whole document using the project’s pipeline (parsetyping) to build a fully-populated Context.
  3. Looks up the identifier in that context and returns its type.
  4. Renders the type string with Markdown syntax highlighting.

Structs§

DefinitionInfo
A resolved definition result: the location where a symbol is defined.
HoverInfo
A resolved hover result: the Markdown-highlighted type and the LSP range.

Functions§

find_definition_at
Main entry-point called by the LSP goto_definition handler.
find_type_at
Main entry-point called by the LSP hover handler.
get_completions_at
Main entry point for LSP completion requests.
highlight_type
Highlight a TypR type string into inline Markdown.