Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 1.21 KB

README.md

File metadata and controls

57 lines (40 loc) · 1.21 KB

LSP

A minimalist Language Server Protocol implementation for educational purposes.

Overview

This project implements basic LSP features to demonstrate protocol fundamentals. It supports markdown files and includes hover information, basic navigation, code actions, and simple completions.

Installation

Clone and install:

git clone git.sr.ht/~vhespanha/lsp && cd lsp
make build
make install

Client Configuration

Neovim

local client = vim.lsp.start_client {
  name = 'educationalsp',
  cmd = { '$HOME/.local/bin/lsp' },
}

if not client then
  vim.notify 'bad client'
  return
end

vim.api.nvim_create_autocmd('Filetype', {
  pattern = 'markdown',
  callback = function()
    vim.lsp.buf_attach_client(0, client)
  end,
})

VSCode

Requires creating a custom extension. See a reference implementation here.

Features

  • Document synchronization (open/change)
  • Hover: Shows file path and character count
  • Definition: Basic line navigation
  • Code actions: Foo → Bar/Baz conversion
  • Completions: Handles "Melange" with description
  • Diagnostics: Basic error detection for "Foo"

License

MIT