modules/orionode/index.js
function loadLanguageServers(servers, io, options) {
	if (Array.isArray(servers) && options.configParams.get('orion.single.user')) {
		const rootPath = path.join(__dirname, "languages");
		if (!fs.existsSync(rootPath)) {
			logger.log("'languages' folder does not exist. Stopped loading language servers.");
			return;
		}
		addModulePath.addPath(rootPath);
		servers.forEach(function(ls) {
			if (typeof ls.module !== "string") {
				logger.log("Language server metadata is missing 'module' property: " + JSON.stringify(ls, null, '\t'));
				return;
			}
			const lsPath = path.join(rootPath, ls.module);
			if (!fs.existsSync(lsPath)) {
				logger.log("Language server folder does not exist: " + lsPath);
				return;
			}
			addModulePath.addPath(lsPath);
			try {
				const server = require(lsPath);
				if (server) {
					lsregistry.installServer(new server(options), { 
							io: io, 
							workspaceDir: workspaceDir,
							IN_PORT: 8123,
							OUT_PORT: 8124
						});
				} else {
					logger.log("Tried to install language server '" + lsPath + "' but could not instantiate it");
				}
			} catch (err) {
				logger.log("Failed to load language server: " + err);
			}
		});
	}
}
function loadLanguageServers(servers, io, options) {
	if (Array.isArray(servers) && options.configParams.get('orion.single.user')) {
		const rootPath = path.join(__dirname, "languages");
		if (!fs.existsSync(rootPath)) {
			logger.log("'languages' folder does not exist. Stopped loading language servers.");
			return;
		}
		addModulePath.addPath(rootPath);
		servers.forEach(function(ls) {
			if (typeof ls.module !== "string") {
				logger.log("Language server metadata is missing 'module' property: " + JSON.stringify(ls, null, '\t'));
				return;
			}
			const lsPath = path.join(rootPath, ls.module);
			if (!fs.existsSync(lsPath)) {
				logger.log("Language server folder does not exist: " + lsPath);
				return;
			}
			addModulePath.addPath(lsPath);
			try {
				const server = require(lsPath);
				if (server) {
					lsregistry.installServer(new server(options), { 
							io: io, 
							workspaceDir: workspaceDir,
							IN_PORT: 8123,
							OUT_PORT: 8124
						});
				} else {
					logger.log("Tried to install language server '" + lsPath + "' but could not instantiate it");
				}
			} catch (err) {
				logger.log("Failed to load language server: " + err);
			}
		});
	}
}
function loadLanguageServers ( servers , io , options ) { if ( Array . isArray ( servers ) && options . configParams . get ( 'orion.single.user' ) ) { const rootPath = path . join ( __dirname , "languages" ) ; if ( ! fs . existsSync ( rootPath ) ) { logger . log ( "'languages' folder does not exist. Stopped loading language servers." ) ; return ; } addModulePath . addPath ( rootPath ) ; servers . forEach ( function ( ls ) { if ( typeof ls . module !== "string" ) { logger . log ( "Language server metadata is missing 'module' property: " + JSON . stringify ( ls , null , '\t' ) ) ; return ; } const lsPath = path . join ( rootPath , ls . module ) ; if ( ! fs . existsSync ( lsPath ) ) { logger . log ( "Language server folder does not exist: " + lsPath ) ; return ; } addModulePath . addPath ( lsPath ) ; try { const server = require ( lsPath ) ; if ( server ) { lsregistry . installServer ( new server ( options ) , { io : io , workspaceDir : workspaceDir , IN_PORT : 8123 , OUT_PORT : 8124 } ) ; } else { logger . log ( "Tried to install language server '" + lsPath + "' but could not instantiate it" ) ; } } catch ( err ) { logger . log ( "Failed to load language server: " + err ) ; } } ) ; } }
Load any language servers mapped to the server config
@param {{?}[]} servers The array of language server metadata
@param {socketio} io The backing socket.IO library
@param {{?}} options The map of server configuration options
@since 18.0
Load any language servers mapped to the server config