Skip to content

Commit

Permalink
some more workspace dynamic registrations
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Dec 4, 2021
1 parent ece3da0 commit 3983642
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/LanguageServerProtocol/Client.swift
Original file line number Diff line number Diff line change
@@ -29,9 +29,9 @@ extension Registration {

return .workspaceDidChangeWatchedFiles(options)
case .workspaceDidChangeConfiguration:
throw ServerError.unhandledMethod(method)
return .workspaceDidChangeConfiguration
case .workspaceDidChangeWorkspaceFolders:
throw ServerError.unhandledMethod(method)
return .workspaceDidChangeWorkspaceFolders
case .textDocumentSemanticTokens:
let options = try reintrepretOptions(SemanticTokensRegistrationOptions.self)

6 changes: 6 additions & 0 deletions Sources/LanguageServerProtocol/LanguageServerProtocol.swift
Original file line number Diff line number Diff line change
@@ -221,13 +221,19 @@ public enum ServerRegistration {

case workspaceDidChangeWatchedFiles(DidChangeWatchedFilesRegistrationOptions)
case textDocumentSemanticTokens(SemanticTokensRegistrationOptions)
case workspaceDidChangeConfiguration
case workspaceDidChangeWorkspaceFolders

public var method: Method {
switch self {
case .workspaceDidChangeWatchedFiles:
return .workspaceDidChangeWatchedFiles
case .textDocumentSemanticTokens:
return .textDocumentSemanticTokens
case .workspaceDidChangeConfiguration:
return .workspaceDidChangeConfiguration
case .workspaceDidChangeWorkspaceFolders:
return .workspaceDidChangeWorkspaceFolders
}
}
}

0 comments on commit 3983642

Please sign in to comment.