code: function initialize(connection, params) {
      var rootPath = params.rootPath,
          workspaceFolders = params.rootPaths;
  
      if(!rootPath && workspaceFolders && Array.isArray(workspaceFolders)) {
          rootPath = workspaceFolders[0];
      }
  
      if (!workspaceFolders) {
          workspaceFolders = [rootPath];
      }
  
      if (workspaceFolders.length) {
          workspaceFolders = Utils.convertToWorkspaceFolders(workspaceFolders);
      }
  
      var _params = {
          rootPath: rootPath,
          rootUri: Utils.pathToUri(rootPath),
          processId: process.pid,
          capabilities: params.capabilities,
          workspaceFolders: workspaceFolders
      };
  
      return connection.sendRequest(protocol.InitializeRequest.type, _params);
  }
docs: Server commands