tricktron / frege-lsp-server

Frege Language Server Using the Language Server Protocol
MIT License
1 stars 0 forks source link

Hover Support #25

Closed tricktron closed 2 years ago

tricktron commented 2 years ago

Fixes #23 and fixes #20.

Goal

Get the type signatures directly from the Frege compiler instead of the Frege Repl.

New Features

Accessing the compiler directly allows us to not only get the type signature of top level functions but also nested local and imported functions. Concretely, hover is currently supported for:

See http://www.frege-lang.org/doc/Language.pdf for details/explanations on CONIDs/VARIDS.

Vision

Do most of the work in Frege.

Architecture

New package layout:

The new structure isolates the two language features diagnostics and hover from each other. In other words, the core module diagnostic.Diagnositc should never import hover.Hover and vice versa.

The LSP conversion is now handled with native declarations. This helps us to do even more work in Frege. The call logic remains the same: HoverService.java (minimal java wrapper) -> HoverLSP.fr (LSP4J Wrapper using native declarations) -> Hover.fr (core class with unit tests).