Skip to content

vhespanha/lsp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Learning to create an LSP from scratch.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published