From aa8fad0b106faabd93cec7cd285fcadfb8191e66 Mon Sep 17 00:00:00 2001 From: coder3101 Date: Mon, 10 Jun 2024 10:22:41 +0530 Subject: [PATCH] docs: Add testing with neovim instructions --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index ec0b91d..2254ebd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,22 @@ # protols Language server for proto files + +## Testing with neovim +```lua +local client = vim.lsp.start_client({ + name = "protols", + cmd = { "" }, +}) + +if not client then + vim.notify("Could not connect to protols server") +end + +vim.api.nvim_create_autocmd("FileType", { + pattern = "proto", + callback = function() + vim.lsp.buf_attach_client(0, client) + end, +}) + +```