Skip to content
This repository has been archived by the owner on Mar 25, 2020. It is now read-only.

Commit

Permalink
Some documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
TJ DeVries committed Nov 21, 2016
1 parent 8fe8643 commit 4852108
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Shim for the language server protocol developed by Microsoft. The protocol can b

## Configuration

First you need to install a language server. An example of installing one might be:

```shell
$ go get github.com/sourcegraph/go-langserver/langserver/cmd/langserver-go
```

You will need to put this somewhere that is sourced on startup.

```vim
Expand Down
14 changes: 12 additions & 2 deletions autoload/langserver/default.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@ let s:langserver_executabe = 'langserver-go'
""
" Get the default command for starting the server
function! langserver#default#cmd() abort
let l:bad_cmd = [-1]

if has_key(g:langserver_executables, &filetype)
return g:langserver_executables[&filetype]['cmd']
let l:tmp_cmd = g:langserver_executables[&filetype]['cmd']

if type(l:tmp_cmd) != type([])
echoerr 'Make sure your dictionary is structued like: {"filetype": {"cmd": [cmd, list, here]}}'
return l:bad_cmd
endif

return l:tmp_cmd
return
else
return [-1]
return l:bad_cmd
endif
endfunction
10 changes: 9 additions & 1 deletion doc/langserver.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ CONFIGURATION *langserver-configuration*
Define a dictionary like this in your vimrc. >
let g:langserver_executables = {
\ 'go': ['langserver-go', '-trace', '-logfile', expand('~/Desktop/langserver-go.log')],
\ 'go': {
\ 'name': 'sourcegraph/langserver-go',
\ 'cmd': ['langserver-go', '-trace', '-logfile', expand('~/Desktop/langserver-go.log')],
\ },
\ }
TODO: Mappings
Expand All @@ -33,6 +36,11 @@ Begin with calling: >
call langserver#start({})
<

or: >
:LSPStart
>
TODO: Opening a file
TODO: Goto definition
TODO: Hover
Expand Down

0 comments on commit 4852108

Please sign in to comment.