Skip to content
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

Fully decode InitializeRequest #756

Merged
merged 2 commits into from Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -110,6 +110,8 @@ public struct InitializeRequest: RequestType, Hashable {
extension InitializeRequest: Codable {
private enum CodingKeys: String, CodingKey {
case processId
case clientInfo
case locale
case rootPath
case rootURI = "rootUri"
case initializationOptions
Expand Down
Expand Up @@ -18,7 +18,7 @@ import XCTest
final class CodingTests: XCTestCase {

func testMessageCoding() {
checkMessageCoding(InitializeRequest(processId: 1, rootPath: "/foo", rootURI: nil, initializationOptions: nil, capabilities: ClientCapabilities(workspace: nil, textDocument: nil), trace: .off, workspaceFolders: nil), id: .number(2), json: """
checkMessageCoding(InitializeRequest(processId: 1, clientInfo: InitializeRequest.ClientInfo(name: "dummy-client", version: "1.0"), locale: "en-US", rootPath: "/foo", rootURI: nil, initializationOptions: nil, capabilities: ClientCapabilities(workspace: nil, textDocument: nil), trace: .off, workspaceFolders: nil), id: .number(2), json: """
{
"id" : 2,
"jsonrpc" : "2.0",
Expand All @@ -27,6 +27,11 @@ final class CodingTests: XCTestCase {
"capabilities" : {

},
"clientInfo" : {
"name" : "dummy-client",
"version" : "1.0"
},
"locale" : "en-US",
"processId" : 1,
"rootPath" : "\\/foo",
"trace" : "off"
Expand Down