$ go get github.com/n04ln/protobuf_langserver
- plz set
$PROTO_PATH
environment variable. However the directory of opened file and${GOPATH}/src/github.com/protocolbuffers/protobuf/src
is already added. This language server through$PROTO_PATH
, search each directory from left to right in the list.
# Example:
export PROTO_PATH=/path/to/proto:/path/to/proto2
- plz write below code in your setting file (maybe
~/.vimrc
or~/.config/nvim/init.vim
) if u usevim-lsp
.
" Example:
if executable('protobuf_langserver')
au User lsp_setup call lsp#register_server({
\ 'name': 'protobuf_server',
\ 'cmd': {server_info->['protobuf_langserver']},
\ 'whitelist': ['proto'],
\ })
endif
- if you wanna to see logs, plz set such as below. you can see
/path/to/logfile
.
" Example with log:
if executable('protobuf_langserver')
au User lsp_setup call lsp#register_server({
\ 'name': 'protobuf_langserver',
\ 'cmd': {server_info->['protobuf_langserver', '-log', '/path/to/logfile']},
\ 'whitelist': ['proto'],
\ })
endif