File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -986,6 +986,8 @@ extension SourceKitLSPServer {
986986    //
987987    // The below is a workaround for the vscode-swift extension since it cannot set client capabilities.
988988    // It passes "workspace/peekDocuments" through the `initializationOptions`.
989+     //
990+     // Similarly for "workspace/textDocumentContent".
989991    var  clientCapabilities  =  req. capabilities
990992    if  case . dictionary( let  initializationOptions)  =  req. initializationOptions { 
991993      if  let  peekDocuments =  initializationOptions [ " workspace/peekDocuments " ]  { 
@@ -997,6 +999,15 @@ extension SourceKitLSPServer {
997999        } 
9981000      } 
9991001
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+ 
10001011      // The client announces what CodeLenses it supports, and the LSP will only return
10011012      // ones found in the supportedCommands dictionary.
10021013      if  let  codeLens =  initializationOptions [ " textDocument/codeLens " ] , 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments