-
Notifications
You must be signed in to change notification settings - Fork 10
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
initial language server protocol implementation #27
base: master
Are you sure you want to change the base?
Conversation
} else { | ||
return getDocumentSymbols(params, node), nil | ||
} | ||
return nil, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[govet] reported by reviewdog 🐶
unreachable code
} | ||
return nil, nil | ||
} else { | ||
return nil, errors.New(fmt.Sprintf("% not open", params.TextDocument.URI)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[govet] reported by reviewdog 🐶
unrecognized printf verb 'n'
ProcessID int `json:"processId,omitempty"` | ||
RootPath string `json:"rootPath,omitempty"` | ||
InitializationOptions InitializeOptions `json:"initializationOptions,omitempty"` | ||
Capabilities ClientCapabilities `json:"capabilities",omitempty` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[govet] reported by reviewdog 🐶
struct field tag json:"capabilities",omitempty
not compatible with reflect.StructTag.Get: bad syntax for struct tag pair
f, err := NewVimFile(params.TextDocument) | ||
if err != nil { | ||
return nil, err | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
if block ends with a return statement, so drop this else and outdent its block
node, err := f.GetAst() | ||
if err != nil { | ||
return nil, err | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
if block ends with a return statement, so drop this else and outdent its block
return getDocumentSymbols(params, node), nil | ||
} | ||
return nil, nil | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
} | ||
return nil, nil | ||
} else { | ||
return nil, errors.New(fmt.Sprintf("% not open", params.TextDocument.URI)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...)
"github.com/sourcegraph/jsonrpc2" | ||
) | ||
|
||
func NewHandler() jsonrpc2.Handler { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported function NewHandler should have comment or be unexported
type SymbolKind int | ||
|
||
const ( | ||
SKFile SymbolKind = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported const SKFile should have comment (or a comment on this block) or be unexported
SKArray SymbolKind = 18 | ||
) | ||
|
||
type SymbolInformation struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported type SymbolInformation should have comment or be unexported
Location Location `json:"location"` | ||
} | ||
|
||
type Location struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported type Location should have comment or be unexported
Range Range `json:"range"` | ||
} | ||
|
||
type Range struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported type Range should have comment or be unexported
End Position `json:"end"` | ||
} | ||
|
||
type Position struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported type Position should have comment or be unexported
1 similar comment
Thanks @prabirshrestha ! It looks interesting. I will check it later soon. |
} | ||
return getDocumentSymbols(params, node), nil | ||
} | ||
return nil, fmt.Errorf("% not open", params.TextDocument.URI) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[govet] reported by reviewdog 🐶
unrecognized printf verb 'n'
Trace string `json:"trace,omitempty"` | ||
} | ||
|
||
type InitializeOptions struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported type InitializeOptions should have comment or be unexported
1 similar comment
Trace string `json:"trace,omitempty"` | ||
} | ||
|
||
type InitializeOptions struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported type InitializeOptions should have comment or be unexported
1 similar comment
Is there any chance of this getting revived? It would be awesome to have a language server for viml! |
@natebosch I believe @haya14busa is still waiting on me to fix lint issues. I haven't been able to have a look at this yet but if you are interested I would be more than happy to give you write access to my repo so that the issues can be addressed first. |
Any update on this? |
No updates from my side. Bit more details at here. #26 I do write vimscript a lot so if someone is willing to take this further I would be glad to help out. |
I implemented completion for @haya14busa If you don't have enough time to do this, I can add some features to integrate to Vim script. |
@prabirshrestha I created efm-langserver that is based on your langserver and haya14busa's errorformat. Thanks. |
Haven't tried it but this does seem promising. https://github.com/iamcco/vim-language-server |
Here is the initial implementation of some of the features of language server protocol (#26)
Currently it only supports 3 method -
initialize
,textDocument/didOpen
,textDocument/documentSymbols
as a proof of concept.This vim plugin is not included in this CR (but if any one wants to try it out let me know and I can share it)
The implementation is similar to https://github.com/sourcegraph/go-langserver
My next step would be to add support for more of the lsp features and also write a vscode plugin so that I can test with a real client.
Note: I'm not a go dev so this may not be idiomatic go code but feel free to comment.