Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update readme to use nvim-lspconfig #8

Merged
merged 2 commits into from
Jun 25, 2024
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{}

```