Skip to content

Commit

Permalink
convert to unix lineendings
Browse files Browse the repository at this point in the history
  • Loading branch information
prabirshrestha committed Dec 24, 2016
1 parent cbb2528 commit b003480
Show file tree
Hide file tree
Showing 3 changed files with 295 additions and 295 deletions.
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Prabir Shrestha
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The MIT License (MIT)

Copyright (c) 2016 Prabir Shrestha

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
120 changes: 60 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
vim-lsp (experimental)
======================

Async [Language Server Protocol](https://github.com/Microsoft/language-server-protocol) plugin for vim8 and neovim.
Internally vim-lsp uses [async.vim](https://github.com/prabirshrestha/async.vim).

Language Server Protocol VIM Client usage
=========================================

Sample usage talking with `langserver-go`

```vim
function! s:on_stderr(id, data, event)
echom 'lsp('.a:id.'):stderr:'.join(a:data, "\r\n")
endfunction
function! s:on_exit(id, status, event)
echom 'lsp('.a:id.'):exit:'.a:status
endfunction
function! s:on_notification(id, data, event)
if lsp#lspClient#is_error(a:data.response)
echom 'lsp('.a:id.'):notification:notification error receieved for '.a:data.request.method
elseif lsp#lspClient#is_server_instantiated_notification(a:data)
" request key will not be present in a:data
" make sure to check before accessing a:data.request in order to prevent unhandled errors
echom 'lsp('.a:id.'):notification:notification success receieved for '.json_encode(a:data.response)
else
echom 'lsp('.a:id.'):notification:notification success receieved for '.a:data.request.method
endif
endfunction
function! s:on_notification1(id, data, event)
echom 'lsp('.a:id.'):notification1:'json_encode(a:data)
endfunction
" go get github.com/sourcegraph/go-langserver/langserver/cmd/langserver-go
let g:lsp_id = lsp#lspClient#start({
\ 'cmd': ['langserver-go', '-trace', '-logfile', expand('~/Desktop/langserver-go.log')],
\ 'on_stderr': function('s:on_stderr'),
\ 'on_exit': function('s:on_exit'),
\ 'on_notification': function('s:on_notification')
\ })
if g:lsp_id > 0
echom 'lsp server running'
call lsp#lspClient#send(g:lsp_id, {
\ 'method': 'initialize',
\ 'params': {
\ 'capabilities': {},
\ 'rootPath': 'file:///D:/go/src/github.com/nsf/gocode'
\ },
\ 'on_notification': function('s:on_notification1')
\ })
else
echom 'failed to start lsp server'
endif
" call lsp#lspClient#stop(g:lsp_id)
```
vim-lsp (experimental)
======================

Async [Language Server Protocol](https://github.com/Microsoft/language-server-protocol) plugin for vim8 and neovim.
Internally vim-lsp uses [async.vim](https://github.com/prabirshrestha/async.vim).

Language Server Protocol VIM Client usage
=========================================

Sample usage talking with `langserver-go`

```vim
function! s:on_stderr(id, data, event)
echom 'lsp('.a:id.'):stderr:'.join(a:data, "\r\n")
endfunction
function! s:on_exit(id, status, event)
echom 'lsp('.a:id.'):exit:'.a:status
endfunction
function! s:on_notification(id, data, event)
if lsp#lspClient#is_error(a:data.response)
echom 'lsp('.a:id.'):notification:notification error receieved for '.a:data.request.method
elseif lsp#lspClient#is_server_instantiated_notification(a:data)
" request key will not be present in a:data
" make sure to check before accessing a:data.request in order to prevent unhandled errors
echom 'lsp('.a:id.'):notification:notification success receieved for '.json_encode(a:data.response)
else
echom 'lsp('.a:id.'):notification:notification success receieved for '.a:data.request.method
endif
endfunction
function! s:on_notification1(id, data, event)
echom 'lsp('.a:id.'):notification1:'json_encode(a:data)
endfunction
" go get github.com/sourcegraph/go-langserver/langserver/cmd/langserver-go
let g:lsp_id = lsp#lspClient#start({
\ 'cmd': ['langserver-go', '-trace', '-logfile', expand('~/Desktop/langserver-go.log')],
\ 'on_stderr': function('s:on_stderr'),
\ 'on_exit': function('s:on_exit'),
\ 'on_notification': function('s:on_notification')
\ })
if g:lsp_id > 0
echom 'lsp server running'
call lsp#lspClient#send(g:lsp_id, {
\ 'method': 'initialize',
\ 'params': {
\ 'capabilities': {},
\ 'rootPath': 'file:///D:/go/src/github.com/nsf/gocode'
\ },
\ 'on_notification': function('s:on_notification1')
\ })
else
echom 'failed to start lsp server'
endif
" call lsp#lspClient#stop(g:lsp_id)
```
Loading

0 comments on commit b003480

Please sign in to comment.