Skip to content

Commit

Permalink
Remove debug logging (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
micnncim authored Sep 12, 2019
1 parent c5b0008 commit b2b1046
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 29 deletions.
4 changes: 0 additions & 4 deletions cmd/protocol-buffers-language-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ func main() {
}

func runServer(ctx context.Context, session source.Session, opts ...server.Option) error {
logger := logging.FromContext(ctx)
logger.Debug("start runServer")
defer logger.Debug("end runServer")

run := func(ctx context.Context, srv *server.Server) {
go srv.Run(ctx)
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/lsp/server/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ import (
func (s *Server) completion(ctx context.Context, params *protocol.CompletionParams) (result *protocol.CompletionList, err error) {
logger := logging.FromContext(ctx)
logger = logger.With(zap.Any("params", params))
logger.Debug("start completion")
defer logger.Debug("end completion")

uri := params.TextDocument.URI
filename := uri.Filename()
Expand Down
6 changes: 0 additions & 6 deletions pkg/lsp/server/definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,12 @@ import (
"github.com/go-language-server/protocol"
"go.uber.org/zap"

"github.com/micnncim/protocol-buffers-language-server/pkg/logging"
"github.com/micnncim/protocol-buffers-language-server/pkg/lsp/source"
)

// TODO: Match position with line and column.
// Currently matches with only line.
func (s *Server) definition(ctx context.Context, params *protocol.TextDocumentPositionParams) (result []protocol.Location, err error) {
logger := logging.FromContext(ctx)
logger = logger.With(zap.Any("params", params))
logger.Debug("start definition")
defer logger.Debug("end definition")

uri := params.TextDocument.URI
filename := uri.Filename()

Expand Down
15 changes: 0 additions & 15 deletions pkg/lsp/server/general.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ import (
func (s *Server) initialize(ctx context.Context, params *protocol.InitializeParams) (result *protocol.InitializeResult, err error) {
logger := logging.FromContext(ctx)
logger = logger.With(zap.Any("params", params))
logger.Debug("start initialize")
defer logger.Debug("end initialize")

s.stateMu.RLock()
state := s.state
Expand Down Expand Up @@ -103,22 +101,13 @@ func (s *Server) initialize(ctx context.Context, params *protocol.InitializePara
}

func (s *Server) initialized(ctx context.Context, params *protocol.InitializedParams) (err error) {
logger := logging.FromContext(ctx)
logger = logger.With(zap.Any("params", params))
logger.Debug("start initialized")
defer logger.Debug("end initialized")

s.stateMu.Lock()
s.state = stateInitialized
s.stateMu.Unlock()
return
}

func (s *Server) shutdown(ctx context.Context) (err error) {
logger := logging.FromContext(ctx)
logger.Debug("start shutdown")
defer logger.Debug("end shutdown")

s.stateMu.RLock()
state := s.state
s.stateMu.RUnlock()
Expand All @@ -134,10 +123,6 @@ func (s *Server) shutdown(ctx context.Context) (err error) {
}

func (s *Server) exit(ctx context.Context) (err error) {
logger := logging.FromContext(ctx)
logger.Debug("start exit")
defer logger.Debug("end exit")

s.stateMu.RLock()
defer s.stateMu.RUnlock()
if s.state != stateShutdown {
Expand Down
2 changes: 0 additions & 2 deletions pkg/lsp/server/text_synchronization.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ import (
func (s *Server) didOpen(ctx context.Context, params *protocol.DidOpenTextDocumentParams) error {
logger := logging.FromContext(ctx)
logger = logger.With(zap.Any("params", params))
logger.Debug("start didOpen")
defer logger.Debug("end didOpen")

uri := params.TextDocument.URI
text := []byte(params.TextDocument.Text)
Expand Down

0 comments on commit b2b1046

Please sign in to comment.