ChimeHQ / LanguageClient

Language Server Protocol (LSP) client for Swift
BSD 3-Clause "New" or "Revised" License
96 stars 10 forks source link

Refactorings to complement large PR in LanguageServerProtocol #9

Closed koliyo closed 10 months ago

koliyo commented 1 year ago

This should be updated to match whatever is decided in the main PR: https://github.com/ChimeHQ/LanguageServerProtocol/pull/8

mattmassicotte commented 10 months ago

I think we can finally revisit this now!

koliyo commented 10 months ago
Building for debugging...
/Users/nils/Work/hylo-lsp/LanguageClient/Tests/LanguageClientTests/ServerTests.swift:46:3: error: global function 'XCTAssertEqual(_:_:_:file:line:)' requires that 'MockServer.ClientMessage' conform to 'Equatable'
                XCTAssertEqual(messages, [
                ^
Swift.Array:1:11: note: requirement from conditional conformance of '[MockServer.ClientMessage]' to 'Equatable'
extension Array : Equatable where Element : Equatable {
          ^
error: fatalError

Note sure what to do about this, if we should make ClientMessage Equatable or refactor test?

mattmassicotte commented 10 months ago

Now that ClientRequest takes captures closures, it is not longer possible to make an equality check. So, it won't be possible to make MockServer.ClientMessage conform to equatable. We'll have to refactor the test.

mattmassicotte commented 10 months ago

I think it will be a little annoying, but it should be possible to do a similar check by pulling out the non-closure data and comparing that.

koliyo commented 10 months ago

Ok, I will leave that to you (?) 😅 Let me know if you need some updates from my side!

mattmassicotte commented 10 months ago

Yeah that makes sense. I'd actually like to look a little more closely at this PR too. Next week!

mattmassicotte commented 10 months ago

Also, Nils, I just wanted to thank you for all your work here. I'm amazed!

Since I don't have other ways to get in touch with you, I just wanted to make you aware that I have a Discord server set up specifically for work on these open source projects. Totally optional, but in case that's your kind of thing: https://discord.gg/esFpX6sErJ

koliyo commented 10 months ago

Well thank you! I'm glad I did not have to start from zero, and this was a great opportunity to get familiar with swift!

I'll join the discord. I probably won't be very active, but nice to be part of the community!