File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -986,6 +986,8 @@ extension SourceKitLSPServer {
986
986
//
987
987
// The below is a workaround for the vscode-swift extension since it cannot set client capabilities.
988
988
// It passes "workspace/peekDocuments" through the `initializationOptions`.
989
+ //
990
+ // Similarly for "workspace/textDocumentContent".
989
991
var clientCapabilities = req. capabilities
990
992
if case . dictionary( let initializationOptions) = req. initializationOptions {
991
993
if let peekDocuments = initializationOptions [ " workspace/peekDocuments " ] {
@@ -997,6 +999,15 @@ extension SourceKitLSPServer {
997
999
}
998
1000
}
999
1001
1002
+ if let textDocumentContent = initializationOptions [ " workspace/textDocumentContent " ] {
1003
+ if case . dictionary( var experimentalCapabilities) = clientCapabilities. experimental {
1004
+ experimentalCapabilities [ " workspace/textDocumentContent " ] = textDocumentContent
1005
+ clientCapabilities. experimental = . dictionary( experimentalCapabilities)
1006
+ } else {
1007
+ clientCapabilities. experimental = . dictionary( [ " workspace/textDocumentContent " : textDocumentContent] )
1008
+ }
1009
+ }
1010
+
1000
1011
// The client announces what CodeLenses it supports, and the LSP will only return
1001
1012
// ones found in the supportedCommands dictionary.
1002
1013
if let codeLens = initializationOptions [ " textDocument/codeLens " ] ,
You can’t perform that action at this time.
0 commit comments