Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,11 @@ A Language Server for **proto3** files. It uses tree-sitter parser for all opera
- [x] Go to definition
- [x] Diagnostics

## Installation and testing
## Installation

Run `cargo install protols` to install and add below to your `init.lua` until we start shipping this via Mason.
Run `cargo install protols` to install and add below to setup using [`nvim-lspconfig`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#protols) until we start shipping this via Mason.

```lua
local client = vim.lsp.start_client({
name = "protols",
cmd = { vim.fn.expand("$HOME/.cargo/bin/protols") },
})

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,
})
require'lspconfig'.protols.setup{}

```