Skip to content

Conversation

@aleh-null
Copy link
Collaborator

@aleh-null aleh-null commented Oct 8, 2024

• Client creates and manages chanel, consumer should handle close properly
• use proper iteration to consume from chanel 
• handle context Done in (h *lspHandler) Handle()

From logs

2024-10-08T22:25:10.658+02:00 DBG pkg/lsp/service.go:338 > Start listening projectId=b7mveZkloA
2024-10-08T22:25:33.362+02:00 DBG pkg/project/manager.go:197 > Deleting project b7mveZkloA
2024-10-08T22:25:43.541+02:00 DBG pkg/lsp/service.go:348 > Done listening projectId=b7mveZkloA
2024-10-08T22:25:43.567+02:00 DBG pkg/project/manager.go:220 > Deleted project b7mveZkloA

}

func NewClient(server Process, diagnosticsChannel chan protocol.PublishDiagnosticsParams) Client {
type Diagnostics <-chan protocol.PublishDiagnosticsParams
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read only chan.

@aleh-null aleh-null requested a review from artmoskvin October 9, 2024 10:47
Comment on lines +340 to +341
// reads fro chanel util it is closed
for diagnostics := range channel {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

til

Copy link
Collaborator

@artmoskvin artmoskvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brilliant!

@aleh-null aleh-null merged commit 50764a3 into main Oct 9, 2024
@aleh-null aleh-null deleted the ap/lsp-diagnostics branch October 9, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants