Skip to content

Add CI workflow to lint and check formatting of Go code #128

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

Merged
merged 8 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Made ProgressProxyHandler private
  • Loading branch information
cmaglie authored and MatteoPologruto committed Aug 4, 2022
commit b0b2d2c85347f5bf55548fe7672ba9b925efb9df
4 changes: 2 additions & 2 deletions ls/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type INOLanguageServer struct {
IDE *IDELSPServer
Clangd *clangdLSPClient

progressHandler *ProgressProxyHandler
progressHandler *progressProxyHandler
closing chan bool
clangdStarted *sync.Cond
dataMux sync.RWMutex
Expand Down Expand Up @@ -144,7 +144,7 @@ func NewINOLanguageServer(stdin io.Reader, stdout io.Writer, config *Config) *IN
logger.Logf("Language server FULL build path: %s", ls.fullBuildPath)

ls.IDE = NewIDELSPServer(logger, stdin, stdout, ls)
ls.progressHandler = NewProgressProxy(ls.IDE.conn)
ls.progressHandler = newProgressProxy(ls.IDE.conn)
go func() {
defer streams.CatchAndLogPanic()
ls.IDE.Run()
Expand Down
22 changes: 11 additions & 11 deletions ls/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"go.bug.st/lsp"
)

type ProgressProxyHandler struct {
type progressProxyHandler struct {
conn *lsp.Server
mux sync.Mutex
actionRequiredCond *sync.Cond
Expand All @@ -34,9 +34,9 @@ type progressProxy struct {
endReq *lsp.WorkDoneProgressEnd
}

// NewProgressProxy creates a new ProgressProxyHandler and returns its pointer
func NewProgressProxy(conn *lsp.Server) *ProgressProxyHandler {
res := &ProgressProxyHandler{
// newProgressProxy creates a new ProgressProxyHandler and returns its pointer
func newProgressProxy(conn *lsp.Server) *progressProxyHandler {
res := &progressProxyHandler{
conn: conn,
proxies: map[string]*progressProxy{},
}
Expand All @@ -48,7 +48,7 @@ func NewProgressProxy(conn *lsp.Server) *ProgressProxyHandler {
return res
}

func (p *ProgressProxyHandler) handlerLoop() {
func (p *progressProxyHandler) handlerLoop() {
p.mux.Lock()
defer p.mux.Unlock()

Expand All @@ -70,7 +70,7 @@ func (p *ProgressProxyHandler) handlerLoop() {
}
}

func (p *ProgressProxyHandler) handleProxy(id string, proxy *progressProxy) {
func (p *progressProxyHandler) handleProxy(id string, proxy *progressProxy) {
switch proxy.currentStatus {
case progressProxyNew:
p.mux.Unlock()
Expand Down Expand Up @@ -132,7 +132,7 @@ func (p *ProgressProxyHandler) handleProxy(id string, proxy *progressProxy) {
}
}

func (p *ProgressProxyHandler) Create(id string) {
func (p *progressProxyHandler) Create(id string) {
p.mux.Lock()
defer p.mux.Unlock()

Expand All @@ -148,7 +148,7 @@ func (p *ProgressProxyHandler) Create(id string) {
p.actionRequiredCond.Broadcast()
}

func (p *ProgressProxyHandler) Begin(id string, req *lsp.WorkDoneProgressBegin) {
func (p *progressProxyHandler) Begin(id string, req *lsp.WorkDoneProgressBegin) {
p.mux.Lock()
defer p.mux.Unlock()

Expand All @@ -168,7 +168,7 @@ func (p *ProgressProxyHandler) Begin(id string, req *lsp.WorkDoneProgressBegin)
p.actionRequiredCond.Broadcast()
}

func (p *ProgressProxyHandler) Report(id string, req *lsp.WorkDoneProgressReport) {
func (p *progressProxyHandler) Report(id string, req *lsp.WorkDoneProgressReport) {
p.mux.Lock()
defer p.mux.Unlock()

Expand All @@ -184,7 +184,7 @@ func (p *ProgressProxyHandler) Report(id string, req *lsp.WorkDoneProgressReport
p.actionRequiredCond.Broadcast()
}

func (p *ProgressProxyHandler) End(id string, req *lsp.WorkDoneProgressEnd) {
func (p *progressProxyHandler) End(id string, req *lsp.WorkDoneProgressEnd) {
p.mux.Lock()
defer p.mux.Unlock()

Expand All @@ -198,7 +198,7 @@ func (p *ProgressProxyHandler) End(id string, req *lsp.WorkDoneProgressEnd) {
p.actionRequiredCond.Broadcast()
}

func (p *ProgressProxyHandler) Shutdown() {
func (p *progressProxyHandler) Shutdown() {
p.mux.Lock()
defer p.mux.Unlock()

Expand Down