Skip to content

Commit

Permalink
fix some golint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
prabirshrestha committed Jan 8, 2017
1 parent d320a46 commit 3351ff2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
7 changes: 3 additions & 4 deletions langserver/handle_text_document_did_open.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ func (h *LangHandler) handleTextDocumentDidOpen(ctx context.Context, conn *jsonr
return nil, err
}

f, err := NewVimFile(params.TextDocument)
f, err := newVimFile(params.TextDocument)
if err != nil {
return nil, err
} else {
h.files[params.TextDocument.URI] = f
return nil, nil
}
h.files[params.TextDocument.URI] = f
return nil, nil
}
8 changes: 2 additions & 6 deletions langserver/handle_text_document_symbol.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package langserver
import (
"context"
"encoding/json"
"errors"
"fmt"

"github.com/haya14busa/go-vimlparser/ast"
Expand All @@ -25,13 +24,10 @@ func (h *LangHandler) handleTextDocumentSymbols(ctx context.Context, conn *jsonr
node, err := f.GetAst()
if err != nil {
return nil, err
} else {
return getDocumentSymbols(params, node), nil
}
return nil, nil
} else {
return nil, errors.New(fmt.Sprintf("% not open", params.TextDocument.URI))
return getDocumentSymbols(params, node), nil
}
return nil, fmt.Errorf("% not open", params.TextDocument.URI)
}

func getDocumentSymbols(params DocumentSymbolParams, node ast.Node) []SymbolInformation {
Expand Down
2 changes: 1 addition & 1 deletion langserver/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type vimfile struct {
AstError error
}

func NewVimFile(textDocumentItem TextDocumentItem) (result *vimfile, error error) {
func newVimFile(textDocumentItem TextDocumentItem) (result *vimfile, error error) {
return &vimfile{
TextDocumentItem: textDocumentItem,
Ast: nil,
Expand Down
4 changes: 2 additions & 2 deletions langserver/lsp.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type InitializeParams struct {
ProcessID int `json:"processId,omitempty"`
RootPath string `json:"rootPath,omitempty"`
InitializationOptions InitializeOptions `json:"initializationOptions,omitempty"`
Capabilities ClientCapabilities `json:"capabilities",omitempty`
Capabilities ClientCapabilities `json:"capabilities,omitempty"`
Trace string `json:"trace,omitempty"`
}

Expand Down Expand Up @@ -33,7 +33,7 @@ type ServerCapabilities struct {

type TextDocumentItem struct {
URI string `json:"uri"`
LanguageId string `json:"languageId"`
LanguageID string `json:"languageId"`
Version int `json:"version"`
Text string `json:"text"`
}
Expand Down

0 comments on commit 3351ff2

Please sign in to comment.