Skip to content

Automatic generation of Language Server support for Domain Specific Languages written in the Miking framework

Notifications You must be signed in to change notification settings

didrikmunther/miking-lsp-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Miking LSP PoC

Version 1

Screen.Recording.2024-05-02.at.12.29.22.mov

Version 2

Goto Definition & Hover Support (Type information)

mexpr-lsp-demo.mov

Code Lens (Run unit tests)

code-lens.mov

Requirements

Programs

  1. VS Code
  2. Make
  3. Node
  4. NPM

Miking

To be able to run this, two changes to the Miking codebase is needed:

  • Remove custom colored output for Miking errors.
  • Remove printing of dots when utests pass.

You can use this branch of Miking

Usage

  1. make all
  2. Press F5 in VS Code
  3. Open test.txt
  4. Try changing float values to integer values to see diagnostics

How it works

Miking LSP

  1. The user opens a plaintext file in VS Code.
  2. The LSP client eventually sends a textDocument/didChange notification to the LSP client.
  3. The LSP client forwards the message to the RPC Wrapper.
  4. The RPC Wrapper strips the RPC header*, and forwards the message to the Miking LSP server.
  5. The Miking LSP server parses the message, compiles the code, and sends a textDocument/publishDiagnostics notification with the results to the RPC Wrapper.
  6. The RPC Wrapper wraps the JSON object with an RPC header, and forwards the message to the LSP client.
  7. The LSP client forwards the message to VS Code, which displays the diagnostics.

*The RPC header consists of the line Content-Length: <n>, describing the length of the JSON body.

Limitations

  • The Miking LSP server doesn't support all LSP features, only the ones needed for this demo.

About

Automatic generation of Language Server support for Domain Specific Languages written in the Miking framework

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published